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)
738738if(ZIG_HOST_TARGET_OS STREQUAL "darwin")
739739 set(ZIG_HOST_TARGET_OS "macos")
740740elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos")
741 check_symbol_exists(__illumos__ "" ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO)
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()
741 set(ZIG_HOST_TARGET_OS "illumos")
747742endif()
748743
749744string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH)
750745if(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")
752747 set(ZIG_HOST_TARGET_ARCH "x86_64")
753748 else()
754749 set(ZIG_HOST_TARGET_ARCH "x86")
build.zig+1-1
......@@ -818,7 +818,7 @@ fn addCmakeCfgOptionsToExe(
818818 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
819819 if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
820820 },
821 .solaris, .illumos => {
821 .illumos => {
822822 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
823823 try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
824824 },
lib/compiler/aro/aro/Compilation.zig+4-4
......@@ -337,7 +337,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
337337 .netbsd => try define(w, "__NetBSD__"),
338338 .openbsd => try define(w, "__OpenBSD__"),
339339 .dragonfly => try define(w, "__DragonFly__"),
340 .solaris => try defineStd(w, "sun", is_gnu),
340 .illumos => try defineStd(w, "sun", is_gnu),
341341 .macos,
342342 .tvos,
343343 .ios,
......@@ -361,7 +361,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
361361 .linux,
362362 .haiku,
363363 .hurd,
364 .solaris,
364 .illumos,
365365 .aix,
366366 .emscripten,
367367 .ps4,
......@@ -618,7 +618,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
618618 try defineStd(w, "sparc", is_gnu);
619619 try define(w, "__sparc_v9__");
620620 try define(w, "__arch64__");
621 if (comp.target.os.tag != .solaris) {
621 if (comp.target.os.tag != .illumos) {
622622 try define(w, "__sparc64__");
623623 try define(w, "__sparc_v9__");
624624 try define(w, "__sparcv9__");
......@@ -626,7 +626,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
626626 },
627627 .sparc => {
628628 try defineStd(w, "sparc", is_gnu);
629 if (comp.target.os.tag == .solaris) {
629 if (comp.target.os.tag == .illumos) {
630630 try define(w, "__sparcv8");
631631 }
632632 },
lib/compiler/aro/aro/Toolchain.zig+4-4
......@@ -391,8 +391,8 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind {
391391 }
392392}
393393
394fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 {
395 if (is_solaris) {
394fn getAsNeededOption(is_illumos: bool, needed: bool) []const u8 {
395 if (is_illumos) {
396396 return if (needed) "-zignore" else "-zrecord";
397397 } else {
398398 return if (needed) "--as-needed" else "--no-as-needed";
......@@ -412,7 +412,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
412412
413413 try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3);
414414 if (as_needed) {
415 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true));
415 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, true));
416416 }
417417 switch (unw) {
418418 .none => return,
......@@ -435,7 +435,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
435435 }
436436
437437 if (as_needed) {
438 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false));
438 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, false));
439439 }
440440}
441441
lib/compiler/aro/aro/target.zig+6-7
......@@ -252,7 +252,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {
252252 target.abi.isAndroid() or
253253 target.os.tag.isBSD() or
254254 target.os.tag == .fuchsia or
255 target.os.tag == .solaris or
255 target.os.tag == .illumos or
256256 target.os.tag == .haiku or
257257 target.cpu.arch == .hexagon)
258258 {
......@@ -281,7 +281,7 @@ pub fn hasFloat128(target: std.Target) bool {
281281 .haiku,
282282 .linux,
283283 .openbsd,
284 .solaris,
284 .illumos,
285285 => target.cpu.arch.isX86(),
286286 else => false,
287287 };
......@@ -654,8 +654,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
654654 .ps3 => "lv2",
655655 .netbsd => "netbsd",
656656 .openbsd => "openbsd",
657 .solaris => "solaris",
658 .illumos => "illumos",
657 .illumos => "solaris",
659658 .windows => "windows",
660659 .zos => "zos",
661660 .haiku => "haiku",
......@@ -755,7 +754,7 @@ pub fn isPIEDefault(target: std.Target) DefaultPIStatus {
755754 .dragonfly,
756755 .netbsd,
757756 .freebsd,
758 .solaris,
757 .illumos,
759758
760759 .cuda,
761760 .amdhsa,
......@@ -838,7 +837,7 @@ pub fn isPICdefault(target: std.Target) DefaultPIStatus {
838837 .openbsd,
839838 .netbsd,
840839 .freebsd,
841 .solaris,
840 .illumos,
842841 .hurd,
843842 => {
844843 return switch (target.cpu.arch) {
......@@ -897,7 +896,7 @@ pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus {
897896 .openbsd,
898897 .netbsd,
899898 .freebsd,
900 .solaris,
899 .illumos,
901900 .cuda,
902901 .ps4,
903902 .ps5,
lib/std/Progress.zig+1-1
......@@ -1547,7 +1547,7 @@ fn handleSigWinch(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopaque)
15471547const have_sigwinch = switch (builtin.os.tag) {
15481548 .linux,
15491549 .plan9,
1550 .solaris,
1550 .illumos,
15511551 .netbsd,
15521552 .openbsd,
15531553 .haiku,
lib/std/Target.zig+15-50
......@@ -27,6 +27,7 @@ pub const Os = struct {
2727 aix,
2828 haiku,
2929 hurd,
30 illumos,
3031 linux,
3132 plan9,
3233 rtems,
......@@ -45,9 +46,6 @@ pub const Os = struct {
4546 visionos,
4647 watchos,
4748
48 illumos,
49 solaris,
50
5149 windows,
5250 uefi,
5351
......@@ -98,10 +96,6 @@ pub const Os = struct {
9896 };
9997 }
10098
101 pub inline fn isSolarish(tag: Tag) bool {
102 return tag == .solaris or tag == .illumos;
103 }
104
10599 pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {
106100 return switch (tag) {
107101 .windows => ".exe",
......@@ -163,11 +157,10 @@ pub const Os = struct {
163157 .managarm,
164158
165159 .haiku,
160 .illumos,
166161 .plan9,
167162 .serenity,
168163
169 .illumos,
170
171164 .ps3,
172165 .ps4,
173166 .ps5,
......@@ -197,8 +190,6 @@ pub const Os = struct {
197190 .visionos,
198191 .watchos,
199192
200 .solaris,
201
202193 .uefi,
203194
204195 .@"3ds",
......@@ -395,11 +386,10 @@ pub const Os = struct {
395386 .managarm,
396387
397388 .haiku,
389 .illumos,
398390 .plan9,
399391 .serenity,
400392
401 .illumos,
402
403393 .ps3,
404394 .ps4,
405395 .ps5,
......@@ -597,13 +587,6 @@ pub const Os = struct {
597587 },
598588 },
599589
600 .solaris => .{
601 .semver = .{
602 .min = .{ .major = 11, .minor = 0, .patch = 0 },
603 .max = .{ .major = 11, .minor = 4, .patch = 0 },
604 },
605 },
606
607590 .windows => .{
608591 .windows = .{
609592 .min = .win10,
......@@ -930,6 +913,7 @@ pub const Abi = enum {
930913 .contiki,
931914 .fuchsia,
932915 .hermit,
916 .illumos,
933917 .managarm,
934918 .plan9,
935919 .serenity,
......@@ -937,8 +921,6 @@ pub const Abi = enum {
937921 .dragonfly,
938922 .driverkit,
939923 .macos,
940 .illumos,
941 .solaris,
942924 .ps3,
943925 .ps4,
944926 .ps5,
......@@ -2043,10 +2025,6 @@ pub const Cpu = struct {
20432025 else => &s390x.cpu.arch8,
20442026 },
20452027 .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 },
20502028 .x86 => &x86.cpu.pentium4,
20512029 .x86_64 => switch (os.tag) {
20522030 .driverkit => &x86.cpu.nehalem,
......@@ -2175,6 +2153,7 @@ pub inline fn isWasiLibC(target: *const Target) bool {
21752153pub fn requiresLibC(target: *const Target) bool {
21762154 return switch (target.os.tag) {
21772155 .aix,
2156 .illumos,
21782157 .driverkit,
21792158 .macos,
21802159 .ios,
......@@ -2184,8 +2163,6 @@ pub fn requiresLibC(target: *const Target) bool {
21842163 .dragonfly,
21852164 .openbsd,
21862165 .haiku,
2187 .solaris,
2188 .illumos,
21892166 .serenity,
21902167 => true,
21912168
......@@ -2332,6 +2309,7 @@ pub const DynamicLinker = struct {
23322309 .fuchsia,
23332310
23342311 .haiku,
2312 .illumos,
23352313 .serenity,
23362314
23372315 .dragonfly,
......@@ -2345,9 +2323,6 @@ pub const DynamicLinker = struct {
23452323 .tvos,
23462324 .visionos,
23472325 .watchos,
2348
2349 .illumos,
2350 .solaris,
23512326 => .arch_os,
23522327 .hurd,
23532328 .linux,
......@@ -2439,6 +2414,14 @@ pub const DynamicLinker = struct {
24392414 else => none,
24402415 },
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
24422425 .linux => if (abi.isAndroid())
24432426 switch (cpu.arch) {
24442427 .arm => if (abi == .androideabi) init("/system/bin/linker") else none,
......@@ -2755,22 +2738,6 @@ pub const DynamicLinker = struct {
27552738 else => none,
27562739 },
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
27742741 // Operating systems in this list have been verified as not having a standard
27752742 // dynamic linker path.
27762743 .freestanding,
......@@ -3134,6 +3101,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31343101 .aix,
31353102 .haiku,
31363103 .hurd,
3104 .illumos,
31373105 .linux,
31383106 .plan9,
31393107 .rtems,
......@@ -3145,9 +3113,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31453113 .netbsd,
31463114 .openbsd,
31473115
3148 .illumos,
3149 .solaris,
3150
31513116 .wasi,
31523117 .emscripten,
31533118 => switch (target.cpu.arch) {
lib/std/Thread.zig+5-5
......@@ -120,7 +120,7 @@ pub const max_name_len = switch (native_os) {
120120 .freebsd => 15,
121121 .openbsd => 23,
122122 .dragonfly => 1023,
123 .solaris, .illumos => 31,
123 .illumos => 31,
124124 // https://github.com/SerenityOS/serenity/blob/6b4c300353da49d3508b5442cf61da70bd04d757/Kernel/Tasks/Thread.h#L102
125125 .serenity => 63,
126126 else => 0,
......@@ -211,7 +211,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void {
211211 else => |e| return posix.unexpectedErrno(e),
212212 }
213213 },
214 .netbsd, .solaris, .illumos => if (use_pthreads) {
214 .netbsd, .illumos => if (use_pthreads) {
215215 const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null);
216216 switch (@as(posix.E, @enumFromInt(err))) {
217217 .SUCCESS => return,
......@@ -324,7 +324,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co
324324 else => |e| return posix.unexpectedErrno(e),
325325 }
326326 },
327 .netbsd, .solaris, .illumos => if (use_pthreads) {
327 .netbsd, .illumos => if (use_pthreads) {
328328 const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);
329329 switch (@as(posix.E, @enumFromInt(err))) {
330330 .SUCCESS => return std.mem.sliceTo(buffer, 0),
......@@ -739,10 +739,10 @@ const PosixThreadImpl = struct {
739739 };
740740 return @as(usize, @intCast(count));
741741 },
742 .solaris, .illumos, .serenity => {
742 .illumos, .serenity => {
743743 // The "proper" way to get the cpu count would be to query
744744 // /dev/kstat via ioctls, and traverse a linked list for each
745 // cpu. (solaris, illumos)
745 // cpu. (illumos)
746746 const rc = c.sysconf(@intFromEnum(std.c._SC.NPROCESSORS_ONLN));
747747 return switch (posix.errno(rc)) {
748748 .SUCCESS => @as(usize, @intCast(rc)),
lib/std/c.zig+129-140
......@@ -14,7 +14,7 @@ const windows = std.os.windows;
1414const ws2_32 = std.os.windows.ws2_32;
1515const darwin = @import("c/darwin.zig");
1616const freebsd = @import("c/freebsd.zig");
17const solaris = @import("c/solaris.zig");
17const illumos = @import("c/illumos.zig");
1818const netbsd = @import("c/netbsd.zig");
1919const dragonfly = @import("c/dragonfly.zig");
2020const haiku = @import("c/haiku.zig");
......@@ -117,7 +117,7 @@ pub const timespec = switch (native_os) {
117117 sec: isize,
118118 nsec: isize,
119119 },
120 .netbsd, .solaris, .illumos => extern struct {
120 .netbsd, .illumos => extern struct {
121121 sec: i64,
122122 nsec: isize,
123123 },
......@@ -132,7 +132,7 @@ pub const dev_t = switch (native_os) {
132132 .linux => linux.dev_t,
133133 .emscripten => emscripten.dev_t,
134134 .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,
136136 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L43
137137 .netbsd, .freebsd, .serenity => u64,
138138 else => void,
......@@ -141,7 +141,7 @@ pub const dev_t = switch (native_os) {
141141pub const mode_t = switch (native_os) {
142142 .linux => linux.mode_t,
143143 .emscripten => emscripten.mode_t,
144 .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi, .windows => u32,
144 .openbsd, .haiku, .netbsd, .illumos, .wasi, .windows => u32,
145145 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L44
146146 .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly, .serenity => u16,
147147 else => u0,
......@@ -153,7 +153,7 @@ pub const nlink_t = switch (native_os) {
153153 .wasi => c_ulonglong,
154154 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L45
155155 .freebsd, .serenity => u64,
156 .openbsd, .netbsd, .solaris, .illumos => u32,
156 .openbsd, .netbsd, .illumos => u32,
157157 .haiku => i32,
158158 else => void,
159159};
......@@ -310,7 +310,7 @@ pub const clockid_t = switch (native_os) {
310310 THREAD_CPUTIME_ID = 14,
311311 PROCESS_CPUTIME_ID = 15,
312312 },
313 .solaris, .illumos => enum(u32) {
313 .illumos => enum(u32) {
314314 VIRTUAL = 1,
315315 THREAD_CPUTIME_ID = 2,
316316 REALTIME = 3,
......@@ -457,7 +457,7 @@ pub const E = switch (native_os) {
457457 },
458458 .macos, .ios, .tvos, .watchos, .visionos => darwin.E,
459459 .freebsd => freebsd.E,
460 .solaris, .illumos => enum(u16) {
460 .illumos => enum(u16) {
461461 /// No error occurred.
462462 SUCCESS = 0,
463463 /// Not super-user
......@@ -1002,7 +1002,7 @@ pub const F = switch (native_os) {
10021002
10031003 pub const GETOWNER_UIDS = 17;
10041004 },
1005 .solaris, .illumos => struct {
1005 .illumos => struct {
10061006 /// Unlock a previously locked region
10071007 pub const ULOCK = 0;
10081008 /// Lock a region for exclusive use
......@@ -1263,7 +1263,7 @@ pub const Flock = switch (native_os) {
12631263 /// Remote system id or zero for local.
12641264 sysid: i32,
12651265 },
1266 .solaris, .illumos => extern struct {
1266 .illumos => extern struct {
12671267 type: c_short,
12681268 whence: c_short,
12691269 start: off_t,
......@@ -1293,7 +1293,7 @@ pub const Flock = switch (native_os) {
12931293pub const HOST_NAME_MAX = switch (native_os) {
12941294 .linux => linux.HOST_NAME_MAX,
12951295 .macos, .ios, .tvos, .watchos, .visionos => 72,
1296 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255,
1296 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => 255,
12971297 // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L22
12981298 .serenity => 64,
12991299 else => {},
......@@ -1302,7 +1302,7 @@ pub const IOV_MAX = switch (native_os) {
13021302 .linux => linux.IOV_MAX,
13031303 .emscripten => emscripten.IOV_MAX,
13041304 // 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,
13061306 .macos, .ios, .tvos, .watchos, .visionos => 16,
13071307 .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
13081308 else => {},
......@@ -1549,7 +1549,7 @@ pub const MADV = switch (native_os) {
15491549 pub const CORE = 9;
15501550 pub const PROTECT = 10;
15511551 },
1552 .solaris, .illumos => struct {
1552 .illumos => struct {
15531553 /// no further special treatment
15541554 pub const NORMAL = 0;
15551555 /// expect random page references
......@@ -1605,9 +1605,8 @@ pub const MCL = switch (native_os) {
16051605 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/088552723935447397400336f5ddb7aa5f5de660/sys/sys/mman.h#L118
16061606 // https://github.com/NetBSD/src/blob/fd2741deca927c18e3ba15acdf78b8b14b2abe36/sys/sys/mman.h#L179
16071607 // 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
16091608 // 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) {
16111610 CURRENT: bool = 0,
16121611 FUTURE: bool = 0,
16131612 _: std.meta.Int(.unsigned, @bitSizeOf(c_int) - 2) = 0,
......@@ -1630,7 +1629,7 @@ pub const MSF = switch (native_os) {
16301629 pub const DEACTIVATE = 0x8;
16311630 pub const SYNC = 0x10;
16321631 },
1633 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct {
1632 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => struct {
16341633 pub const ASYNC = 1;
16351634 pub const INVALIDATE = 2;
16361635 pub const SYNC = 4;
......@@ -1650,7 +1649,7 @@ pub const NAME_MAX = switch (native_os) {
16501649 // character, but POSIX definition says that NAME_MAX does not include the
16511650 // terminating null.
16521651 // 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,
16541653 else => {},
16551654};
16561655pub const PATH_MAX = switch (native_os) {
......@@ -1658,7 +1657,7 @@ pub const PATH_MAX = switch (native_os) {
16581657 .emscripten => emscripten.PATH_MAX,
16591658 .wasi => 4096,
16601659 .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,
16621661 else => {},
16631662};
16641663
......@@ -1721,7 +1720,7 @@ pub const POLL = switch (native_os) {
17211720
17221721 pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
17231722 },
1724 .solaris, .illumos => struct {
1723 .illumos => struct {
17251724 pub const IN = 0x0001;
17261725 pub const PRI = 0x0002;
17271726 pub const OUT = 0x0004;
......@@ -1812,7 +1811,7 @@ pub const PROT = switch (native_os) {
18121811 .linux => linux.PROT,
18131812 .emscripten => emscripten.PROT,
18141813 // 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 {
18161815 /// page can not be accessed
18171816 pub const NONE = 0x0;
18181817 /// page can be read
......@@ -1852,7 +1851,7 @@ pub const RLIM = switch (native_os) {
18521851 pub const SAVED_MAX = INFINITY;
18531852 pub const SAVED_CUR = INFINITY;
18541853 },
1855 .solaris, .illumos => struct {
1854 .illumos => struct {
18561855 /// No limit
18571856 pub const INFINITY: rlim_t = (1 << 63) - 3;
18581857 pub const SAVED_MAX: rlim_t = (1 << 63) - 2;
......@@ -2022,7 +2021,7 @@ pub const S = switch (native_os) {
20222021 return m & IFMT == IFWHT;
20232022 }
20242023 },
2025 .solaris, .illumos => struct {
2024 .illumos => struct {
20262025 pub const IFMT = 0o170000;
20272026
20282027 pub const IFIFO = 0o010000;
......@@ -2424,7 +2423,7 @@ pub const SA = switch (native_os) {
24242423 pub const NOCLDWAIT = 0x0020;
24252424 pub const SIGINFO = 0x0040;
24262425 },
2427 .solaris, .illumos => struct {
2426 .illumos => struct {
24282427 pub const ONSTACK = 0x00000001;
24292428 pub const RESETHAND = 0x00000002;
24302429 pub const RESTART = 0x00000004;
......@@ -2485,7 +2484,7 @@ pub const SA = switch (native_os) {
24852484 else => void,
24862485};
24872486pub const sigval_t = switch (native_os) {
2488 .netbsd, .solaris, .illumos => extern union {
2487 .netbsd, .illumos => extern union {
24892488 int: i32,
24902489 ptr: ?*anyopaque,
24912490 },
......@@ -2525,7 +2524,7 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
25252524 .openbsd => enum(c_int) {
25262525 PAGESIZE = 28,
25272526 },
2528 .solaris, .illumos => enum(c_int) {
2527 .illumos => enum(c_int) {
25292528 PAGESIZE = 11,
25302529 NPROCESSORS_ONLN = 15,
25312530 SIGRT_MIN = 40,
......@@ -2566,7 +2565,7 @@ pub const SEEK = switch (native_os) {
25662565 pub const CUR = 1;
25672566 pub const END = 2;
25682567 },
2569 .dragonfly, .solaris, .illumos => struct {
2568 .dragonfly, .illumos => struct {
25702569 pub const SET = 0;
25712570 pub const CUR = 1;
25722571 pub const END = 2;
......@@ -2765,7 +2764,7 @@ pub const SIG = switch (native_os) {
27652764 return sig <= MAXSIG and sig > 0;
27662765 }
27672766 },
2768 .solaris, .illumos => struct {
2767 .illumos => struct {
27692768 pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
27702769 pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
27712770 pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
......@@ -3089,7 +3088,7 @@ pub const SIG = switch (native_os) {
30893088pub const SIOCGIFINDEX = switch (native_os) {
30903089 .linux => linux.SIOCGIFINDEX,
30913090 .emscripten => emscripten.SIOCGIFINDEX,
3092 .solaris, .illumos => solaris.SIOCGLIFINDEX,
3091 .illumos => illumos.SIOCGLIFINDEX,
30933092 // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L118
30943093 .serenity => 34,
30953094 else => void,
......@@ -3204,7 +3203,7 @@ pub const Sigaction = switch (native_os) {
32043203 /// signal mask to apply
32053204 mask: sigset_t,
32063205 },
3207 .solaris, .illumos => extern struct {
3206 .illumos => extern struct {
32083207 pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
32093208 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) {
33013300 pub const IOCGPTN = 0x4004740f;
33023301 pub const IOCSIG = 0x2004745f;
33033302 },
3304 .solaris, .illumos => struct {
3303 .illumos => struct {
33053304 pub const CGETA = tioc('T', 1);
33063305 pub const CSETA = tioc('T', 2);
33073306 pub const CSETAW = tioc('T', 3);
......@@ -3731,7 +3730,7 @@ pub const W = switch (native_os) {
37313730 return (s & 0xffff) -% 1 < 0xff;
37323731 }
37333732 },
3734 .solaris, .illumos => struct {
3733 .illumos => struct {
37353734 pub const EXITED = 0o001;
37363735 pub const TRAPPED = 0o002;
37373736 pub const UNTRACED = 0o004;
......@@ -3944,7 +3943,7 @@ pub const clock_t = switch (native_os) {
39443943 .emscripten => emscripten.clock_t,
39453944 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
39463945 .freebsd => isize,
3947 .openbsd, .solaris, .illumos => i64,
3946 .openbsd, .illumos => i64,
39483947 .netbsd => u32,
39493948 .haiku => i32,
39503949 // 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) {
39753974 tls_modid: usize,
39763975 tls_data: ?*anyopaque,
39773976 },
3978 .solaris, .illumos => extern struct {
3977 .illumos => extern struct {
39793978 addr: std.elf.Addr,
39803979 name: ?[*:0]const u8,
39813980 phdr: [*]std.elf.Phdr,
......@@ -4001,7 +4000,7 @@ pub const epoll_event = switch (native_os) {
40014000pub const ifreq = switch (native_os) {
40024001 .linux => linux.ifreq,
40034002 .emscripten => emscripten.ifreq,
4004 .solaris, .illumos => lifreq,
4003 .illumos => lifreq,
40054004 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L49-L82
40064005 .serenity => extern struct {
40074006 // Not actually in a union, but the stdlib expects one for ifreq
......@@ -4026,10 +4025,9 @@ pub const ifreq = switch (native_os) {
40264025};
40274026pub const in_pktinfo = switch (native_os) {
40284027 .linux => linux.in_pktinfo,
4029 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/netinet/in.h#L1084
40304028 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1132
40314029 // 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 {
40334031 ifindex: u32,
40344032 spec_dst: u32,
40354033 addr: u32,
......@@ -4042,12 +4040,11 @@ pub const in6_pktinfo = switch (native_os) {
40424040 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/netinet6/in6.h#L575
40434041 // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/netinet6/in6.h#L468
40444042 // 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
40464043 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L114IP1
40474044 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet6/in6.h#L737
40484045 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/netinet6/in6.h#L63
40494046 // 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 {
40514048 addr: [16]u8,
40524049 ifindex: u32,
40534050 },
......@@ -4071,8 +4068,6 @@ pub const linger = switch (native_os) {
40714068 .netbsd,
40724069 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/sys/socket.h#L126
40734070 .openbsd,
4074 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L214
4075 .solaris,
40764071 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/sys/socket.h#L250
40774072 .illumos,
40784073 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/sys/socket.h#L87
......@@ -4100,7 +4095,6 @@ pub const msghdr = switch (native_os) {
41004095 .freebsd,
41014096 .netbsd,
41024097 .haiku,
4103 .solaris,
41044098 .illumos,
41054099 .macos,
41064100 .driverkit,
......@@ -4144,7 +4138,6 @@ pub const msghdr_const = switch (native_os) {
41444138 .freebsd,
41454139 .netbsd,
41464140 .haiku,
4147 .solaris,
41484141 .illumos,
41494142 .macos,
41504143 .driverkit,
......@@ -4190,8 +4183,6 @@ pub const cmsghdr = switch (native_os) {
41904183 .netbsd,
41914184 // https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L527
41924185 .openbsd,
4193 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L416
4194 .solaris,
41954186 // https://github.com/illumos/illumos-gate/blob/afdf2e523873cb523df379676067bf9785a0f456/usr/src/uts/common/sys/socket.h#L460
41964187 .illumos,
41974188 // https://github.com/SerenityOS/serenity/blob/4ee360a348a5e2490eeaeeabb3eb19e70dd450eb/Kernel/API/POSIX/sys/socket.h#L68
......@@ -4215,7 +4206,7 @@ pub const cmsghdr = switch (native_os) {
42154206pub const nfds_t = switch (native_os) {
42164207 .linux => linux.nfds_t,
42174208 .emscripten => emscripten.nfds_t,
4218 .haiku, .solaris, .illumos, .wasi => usize,
4209 .haiku, .illumos, .wasi => usize,
42194210 .windows => c_ulong,
42204211 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
42214212 // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L32
......@@ -4253,7 +4244,7 @@ pub const pollfd = switch (native_os) {
42534244pub const rlim_t = switch (native_os) {
42544245 .linux => linux.rlim_t,
42554246 .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,
42574248 .haiku, .dragonfly, .freebsd => i64,
42584249 // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L54
42594250 .serenity => usize,
......@@ -4307,7 +4298,7 @@ pub const rlimit_resource = switch (native_os) {
43074298
43084299 pub const AS: rlimit_resource = .VMEM;
43094300 },
4310 .solaris, .illumos => enum(c_int) {
4301 .illumos => enum(c_int) {
43114302 CPU = 0,
43124303 FSIZE = 1,
43134304 DATA = 2,
......@@ -4401,7 +4392,7 @@ pub const rusage = switch (native_os) {
44014392 pub const SELF = 0;
44024393 pub const CHILDREN = -1;
44034394 },
4404 .solaris, .illumos => extern struct {
4395 .illumos => extern struct {
44054396 utime: timeval,
44064397 stime: timeval,
44074398 maxrss: isize,
......@@ -4510,7 +4501,7 @@ pub const siginfo_t = switch (native_os) {
45104501 },
45114502 },
45124503 },
4513 .solaris, .illumos => extern struct {
4504 .illumos => extern struct {
45144505 signo: c_int,
45154506 code: c_int,
45164507 errno: c_int,
......@@ -4530,8 +4521,8 @@ pub const siginfo_t = switch (native_os) {
45304521 stime: clock_t,
45314522 },
45324523 },
4533 contract: solaris.ctid_t,
4534 zone: solaris.zoneid_t,
4524 contract: illumos.ctid_t,
4525 zone: illumos.zoneid_t,
45354526 },
45364527 fault: extern struct {
45374528 addr: *allowzero anyopaque,
......@@ -4642,7 +4633,7 @@ pub const sigset_t = switch (native_os) {
46424633 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L19
46434634 .openbsd, .serenity => u32,
46444635 .macos, .ios, .tvos, .watchos, .visionos => darwin.sigset_t,
4645 .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct {
4636 .dragonfly, .netbsd, .illumos, .freebsd => extern struct {
46464637 __bits: [SIG.WORDS]u32,
46474638 },
46484639 .haiku => u64,
......@@ -4681,7 +4672,7 @@ pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
46814672 addr: ?*sockaddr,
46824673 next: ?*addrinfo,
46834674 },
4684 .solaris, .illumos => extern struct {
4675 .illumos => extern struct {
46854676 flags: AI,
46864677 family: i32,
46874678 socktype: i32,
......@@ -4819,7 +4810,7 @@ pub const sockaddr = switch (native_os) {
48194810 path: [104]u8,
48204811 };
48214812 },
4822 .solaris, .illumos => extern struct {
4813 .illumos => extern struct {
48234814 /// address family
48244815 family: sa_family_t,
48254816
......@@ -5081,7 +5072,7 @@ pub const sa_family_t = switch (native_os) {
50815072 .windows => ws2_32.ADDRESS_FAMILY,
50825073 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,
50835074 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L66
5084 .solaris, .illumos, .serenity => u16,
5075 .illumos, .serenity => u16,
50855076 else => void,
50865077};
50875078pub const AF = if (builtin.abi.isAndroid()) struct {
......@@ -5219,7 +5210,7 @@ pub const AF = if (builtin.abi.isAndroid()) struct {
52195210 pub const INET6_SDP = 42;
52205211 pub const MAX = 42;
52215212 },
5222 .solaris, .illumos => struct {
5213 .illumos => struct {
52235214 pub const UNSPEC = 0;
52245215 pub const UNIX = 1;
52255216 pub const LOCAL = UNIX;
......@@ -5499,7 +5490,7 @@ pub const PF = if (builtin.abi.isAndroid()) struct {
54995490 pub const INET6_SDP = AF.INET6_SDP;
55005491 pub const MAX = AF.MAX;
55015492 },
5502 .solaris, .illumos => struct {
5493 .illumos => struct {
55035494 pub const UNSPEC = AF.UNSPEC;
55045495 pub const UNIX = AF.UNIX;
55055496 pub const LOCAL = UNIX;
......@@ -5778,7 +5769,7 @@ pub const MSG = switch (native_os) {
57785769 pub const FBLOCKING = 0x10000;
57795770 pub const FNONBLOCKING = 0x20000;
57805771 },
5781 .solaris, .illumos => struct {
5772 .illumos => struct {
57825773 pub const OOB = 0x0001;
57835774 pub const PEEK = 0x0002;
57845775 pub const DONTROUTE = 0x0004;
......@@ -5825,7 +5816,7 @@ pub const SOCK = switch (native_os) {
58255816 pub const CLOEXEC = 0x10000000;
58265817 pub const NONBLOCK = 0x20000000;
58275818 },
5828 .solaris, .illumos => struct {
5819 .illumos => struct {
58295820 /// Datagram.
58305821 pub const DGRAM = 1;
58315822 /// STREAM.
......@@ -6155,7 +6146,7 @@ pub const IPPROTO = switch (native_os) {
61556146 /// Reserved
61566147 pub const RESERVED_254 = 254;
61576148 },
6158 .solaris, .illumos => struct {
6149 .illumos => struct {
61596150 /// dummy for IP
61606151 pub const IP = 0;
61616152 /// Hop by hop header for IPv6
......@@ -6514,7 +6505,7 @@ pub const IP = switch (native_os) {
65146505 .dragonfly => dragonfly.IP,
65156506 .netbsd => netbsd.IP,
65166507 .openbsd => openbsd.IP,
6517 .solaris, .illumos => solaris.IP,
6508 .illumos => illumos.IP,
65186509 .haiku => haiku.IP,
65196510 .serenity => serenity.IP,
65206511 else => void,
......@@ -6525,7 +6516,7 @@ pub const IPV6 = switch (native_os) {
65256516 .dragonfly => dragonfly.IPV6,
65266517 .netbsd => netbsd.IPV6,
65276518 .openbsd => openbsd.IPV6,
6528 .solaris, .illumos => solaris.IPV6,
6519 .illumos => illumos.IPV6,
65296520 .haiku => haiku.IPV6,
65306521 .serenity => serenity.IPV6,
65316522 else => void,
......@@ -6536,7 +6527,7 @@ pub const IPTOS = switch (native_os) {
65366527 .dragonfly => dragonfly.IPTOS,
65376528 .netbsd => netbsd.IPTOS,
65386529 .openbsd => openbsd.IPTOS,
6539 .solaris, .illumos => solaris.IPTOS,
6530 .illumos => illumos.IPTOS,
65406531 .haiku => haiku.IPTOS,
65416532 .serenity => serenity.IPTOS,
65426533 else => void,
......@@ -6548,7 +6539,7 @@ pub const SOL = switch (native_os) {
65486539 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
65496540 pub const SOCKET = 0xffff;
65506541 },
6551 .solaris, .illumos => struct {
6542 .illumos => struct {
65526543 pub const SOCKET = 0xffff;
65536544 pub const ROUTE = 0xfffe;
65546545 pub const PACKET = 0xfffd;
......@@ -6632,7 +6623,7 @@ pub const SO = switch (native_os) {
66326623 pub const MAX_PACING_RATE = 0x1018;
66336624 pub const DOMAIN = 0x1019;
66346625 },
6635 .solaris, .illumos => struct {
6626 .illumos => struct {
66366627 pub const DEBUG = 0x0001;
66376628 pub const ACCEPTCONN = 0x0002;
66386629 pub const REUSEADDR = 0x0004;
......@@ -6803,7 +6794,7 @@ pub const SOMAXCONN = switch (native_os) {
68036794 .linux => linux.SOMAXCONN,
68046795 .windows => ws2_32.SOMAXCONN,
68056796 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L128
6806 .solaris, .illumos, .serenity => 128,
6797 .illumos, .serenity => 128,
68076798 // https://github.com/freebsd/freebsd-src/blob/9ab31f821ad1c6bad474510447387c50bef2c24c/sys/sys/socket.h#L434
68086799 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/fd3d1949d526ffa646e57037770acd6f2f3bb617/sys/sys/socket.h#L393
68096800 // https://github.com/NetBSD/src/blob/a673fb3f8487e974c669216064f7588207229fea/sys/sys/socket.h#L472
......@@ -6814,9 +6805,8 @@ pub const SOMAXCONN = switch (native_os) {
68146805};
68156806pub const SCM = switch (native_os) {
68166807 .linux, .emscripten => linux.SCM,
6817 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L172
68186808 // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L196
6819 .solaris, .illumos => struct {
6809 .illumos => struct {
68206810 pub const RIGHTS = 0x1010;
68216811 pub const UCRED = 0x1012;
68226812 pub const TIMESTAMP = SO.TIMESTAMP;
......@@ -6874,7 +6864,7 @@ pub const IFNAMESIZE = switch (native_os) {
68746864 .windows => 30,
68756865 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L50
68766866 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 16,
6877 .solaris, .illumos => 32,
6867 .illumos => 32,
68786868 else => void,
68796869};
68806870
......@@ -6910,7 +6900,7 @@ pub const time_t = switch (native_os) {
69106900};
69116901pub const suseconds_t = switch (native_os) {
69126902 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L49
6913 .solaris, .illumos, .serenity => i64,
6903 .illumos, .serenity => i64,
69146904 .freebsd, .dragonfly => c_long,
69156905 .netbsd => c_int,
69166906 .haiku => i32,
......@@ -6929,7 +6919,7 @@ pub const timeval = switch (native_os) {
69296919 usec: i32,
69306920 },
69316921 // 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 {
69336923 /// seconds
69346924 sec: time_t,
69356925 /// microseconds
......@@ -6963,7 +6953,7 @@ pub const user_desc = switch (native_os) {
69636953pub const utsname = switch (native_os) {
69646954 .linux => linux.utsname,
69656955 .emscripten => emscripten.utsname,
6966 .solaris, .illumos => extern struct {
6956 .illumos => extern struct {
69676957 sysname: [256:0]u8,
69686958 nodename: [256:0]u8,
69696959 release: [256:0]u8,
......@@ -7003,7 +6993,7 @@ pub const _errno = switch (native_os) {
70036993 .wasi, .dragonfly => private.errnoFromThreadLocal,
70046994 .windows => private._errno,
70056995 .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,
7006 .solaris, .illumos => private.___errno,
6996 .illumos => private.___errno,
70076997 .openbsd, .netbsd => private.__errno,
70086998 .haiku => haiku._errnop,
70096999 // https://github.com/SerenityOS/serenity/blob/a353ceecf13b6f156a078e32f1ddf1d21366934c/Userland/Libraries/LibC/errno.h#L33
......@@ -7049,7 +7039,7 @@ pub const RTLD = switch (native_os) {
70497039 NOLOAD: bool = false,
70507040 _: u18 = 0,
70517041 },
7052 .solaris, .illumos => packed struct(u32) {
7042 .illumos => packed struct(u32) {
70537043 LAZY: bool = false,
70547044 NOW: bool = false,
70557045 NOLOAD: bool = false,
......@@ -7128,7 +7118,7 @@ pub const dirent = switch (native_os) {
71287118 /// Name of entry.
71297119 name: [255:0]u8,
71307120 },
7131 .solaris, .illumos => extern struct {
7121 .illumos => extern struct {
71327122 /// Inode number of entry.
71337123 ino: ino_t,
71347124 /// Offset of this entry on disk.
......@@ -7177,7 +7167,7 @@ pub const dirent = switch (native_os) {
71777167 else => void,
71787168};
71797169pub const MAXNAMLEN = switch (native_os) {
7180 .netbsd, .solaris, .illumos => 511,
7170 .netbsd, .illumos => 511,
71817171 // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L37
71827172 .haiku, .serenity => NAME_MAX,
71837173 .openbsd => 255,
......@@ -7228,7 +7218,7 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
72287218 ADDRCONFIG: bool = false,
72297219 _: u21 = 0,
72307220 },
7231 .solaris, .illumos => packed struct(u32) {
7221 .illumos => packed struct(u32) {
72327222 V4MAPPED: bool = false,
72337223 ALL: bool = false,
72347224 ADDRCONFIG: bool = false,
......@@ -7286,7 +7276,7 @@ pub const NI = switch (native_os) {
72867276 NUMERICSCOPE: bool = false,
72877277 _: u23 = 0,
72887278 },
7289 .solaris, .illumos => packed struct(u32) {
7279 .illumos => packed struct(u32) {
72907280 NOFQDN: bool = false,
72917281 NUMERICHOST: bool = false,
72927282 NAMEREQD: bool = false,
......@@ -7396,7 +7386,7 @@ pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {
73967386 OVERFLOW = 14,
73977387 _,
73987388 },
7399 .solaris, .illumos => enum(c_int) {
7389 .illumos => enum(c_int) {
74007390 /// address family for hostname not supported
74017391 ADDRFAMILY = 1,
74027392 /// name could not be resolved at this time
......@@ -7736,7 +7726,7 @@ pub const Stat = switch (native_os) {
77367726 }
77377727 },
77387728 .freebsd => freebsd.Stat,
7739 .solaris, .illumos => extern struct {
7729 .illumos => extern struct {
77407730 dev: dev_t,
77417731 ino: ino_t,
77427732 mode: mode_t,
......@@ -7970,7 +7960,7 @@ pub const pthread_mutex_t = switch (native_os) {
79707960 owner: i32 = -1,
79717961 owner_count: i32 = 0,
79727962 },
7973 .solaris, .illumos => extern struct {
7963 .illumos => extern struct {
79747964 flag1: u16 = 0,
79757965 flag2: u8 = 0,
79767966 ceiling: u8 = 0,
......@@ -8025,7 +8015,7 @@ pub const pthread_cond_t = switch (native_os) {
80258015 waiter_count: i32 = 0,
80268016 lock: i32 = 0,
80278017 },
8028 .solaris, .illumos => extern struct {
8018 .illumos => extern struct {
80298019 flag: [4]u8 = [_]u8{0} ** 4,
80308020 type: u16 = 0,
80318021 magic: u16 = 0x4356,
......@@ -8084,7 +8074,7 @@ pub const pthread_rwlock_t = switch (native_os) {
80848074 owner: ?pthread_t = null,
80858075 private: ?*anyopaque = null,
80868076 },
8087 .solaris, .illumos => extern struct {
8077 .illumos => extern struct {
80888078 readers: i32 = 0,
80898079 type: u16 = 0,
80908080 magic: u16 = 0x5257,
......@@ -8118,7 +8108,7 @@ pub const pthread_attr_t = switch (native_os) {
81188108 .freebsd, .openbsd, .serenity => extern struct {
81198109 inner: ?*anyopaque = null,
81208110 },
8121 .solaris, .illumos => extern struct {
8111 .illumos => extern struct {
81228112 mutexattr: ?*anyopaque = null,
81238113 },
81248114 .netbsd => extern struct {
......@@ -8140,7 +8130,7 @@ pub const pthread_key_t = switch (native_os) {
81408130 .linux, .emscripten => c_uint,
81418131 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
81428132 // 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,
81448134 else => void,
81458135};
81468136
......@@ -8180,7 +8170,7 @@ pub const sem_t = switch (native_os) {
81808170 },
81818171 _padding: u32,
81828172 },
8183 .solaris, .illumos => extern struct {
8173 .illumos => extern struct {
81848174 count: u32 = 0,
81858175 type: u16 = 0,
81868176 magic: u16 = 0x534d,
......@@ -8271,12 +8261,12 @@ pub const Kevent = switch (native_os) {
82718261};
82728262
82738263pub const port_t = switch (native_os) {
8274 .solaris, .illumos => c_int,
8264 .illumos => c_int,
82758265 else => void,
82768266};
82778267
82788268pub const port_event = switch (native_os) {
8279 .solaris, .illumos => extern struct {
8269 .illumos => extern struct {
82808270 events: u32,
82818271 /// Event source.
82828272 source: u16,
......@@ -8364,7 +8354,7 @@ pub const AT = switch (native_os) {
83648354 pub const REMOVEDIR = 0x04;
83658355 pub const EACCESS = 0x08;
83668356 },
8367 .solaris, .illumos => struct {
8357 .illumos => struct {
83688358 /// Magic value that specify the use of the current working directory
83698359 /// to determine the target of relative file paths in the openat() and
83708360 /// similar syscalls.
......@@ -8461,7 +8451,7 @@ pub const O = switch (native_os) {
84618451 // ignored in C code. Thus no mapping in Zig.
84628452 _: u3 = 0,
84638453 },
8464 .solaris, .illumos => packed struct(u32) {
8454 .illumos => packed struct(u32) {
84658455 ACCMODE: std.posix.ACCMODE = .RDONLY,
84668456 NDELAY: bool = false,
84678457 APPEND: bool = false,
......@@ -8672,7 +8662,7 @@ pub const MAP = switch (native_os) {
86728662 FIXED_NOREPLACE: bool = false,
86738663 _: u11 = 0,
86748664 },
8675 .solaris, .illumos => packed struct(u32) {
8665 .illumos => packed struct(u32) {
86768666 TYPE: enum(u4) {
86778667 SHARED = 0x01,
86788668 PRIVATE = 0x02,
......@@ -8869,7 +8859,7 @@ pub const V = switch (native_os) {
88698859 STOP,
88708860 SUSP,
88718861 },
8872 .solaris, .illumos => enum {
8862 .illumos => enum {
88738863 INTR,
88748864 QUIT,
88758865 ERASE,
......@@ -8936,7 +8926,7 @@ pub const NCCS = switch (native_os) {
89368926 .linux => linux.NCCS,
89378927 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
89388928 .haiku => 11,
8939 .solaris, .illumos => 19,
8929 .illumos => 19,
89408930 // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L15
89418931 .emscripten, .wasi, .serenity => 32,
89428932 else => void,
......@@ -8973,7 +8963,7 @@ pub const termios = switch (native_os) {
89738963 ospeed: speed_t,
89748964 cc: [NCCS]cc_t,
89758965 },
8976 .solaris, .illumos => extern struct {
8966 .illumos => extern struct {
89778967 iflag: tc_iflag_t,
89788968 oflag: tc_oflag_t,
89798969 cflag: tc_cflag_t,
......@@ -9063,7 +9053,7 @@ pub const tc_iflag_t = switch (native_os) {
90639053 IXOFF: bool = false,
90649054 _: u19 = 0,
90659055 },
9066 .solaris, .illumos => packed struct(u32) {
9056 .illumos => packed struct(u32) {
90679057 IGNBRK: bool = false,
90689058 BRKINT: bool = false,
90699059 IGNPAR: bool = false,
......@@ -9156,7 +9146,7 @@ pub const tc_oflag_t = switch (native_os) {
91569146 ONLRET: bool = false,
91579147 _: u25 = 0,
91589148 },
9159 .solaris, .illumos => packed struct(u32) {
9149 .illumos => packed struct(u32) {
91609150 OPOST: bool = false,
91619151 OLCUC: bool = false,
91629152 ONLCR: bool = false,
......@@ -9303,7 +9293,7 @@ pub const tc_cflag_t = switch (native_os) {
93039293 RTSFLOW: bool = false,
93049294 _: u17 = 0,
93059295 },
9306 .solaris, .illumos => packed struct(u32) {
9296 .illumos => packed struct(u32) {
93079297 _0: u4 = 0,
93089298 CSIZE: CSIZE = .CS5,
93099299 CSTOPB: bool = false,
......@@ -9441,7 +9431,7 @@ pub const tc_lflag_t = switch (native_os) {
94419431 PENDIN: bool = false,
94429432 _: u17 = 0,
94439433 },
9444 .solaris, .illumos => packed struct(u32) {
9434 .illumos => packed struct(u32) {
94459435 ISIG: bool = false,
94469436 ICANON: bool = false,
94479437 XCASE: bool = false,
......@@ -9609,7 +9599,7 @@ pub const speed_t = switch (native_os) {
96099599 B230400 = 0x12,
96109600 B31250 = 0x13,
96119601 },
9612 .solaris, .illumos => enum(c_uint) {
9602 .illumos => enum(c_uint) {
96139603 B0 = 0,
96149604 B50 = 1,
96159605 B75 = 2,
......@@ -9696,7 +9686,7 @@ pub const NSIG = switch (native_os) {
96969686 .haiku => 65,
96979687 .netbsd, .freebsd => 32,
96989688 .macos => darwin.NSIG,
9699 .solaris, .illumos => 75,
9689 .illumos => 75,
97009690 // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h#L42
97019691 .openbsd, .serenity => 33,
97029692 else => {},
......@@ -9709,7 +9699,7 @@ pub const MINSIGSTKSZ = switch (native_os) {
97099699 .arm, .aarch64 => 4096,
97109700 else => @compileError("unsupported arch"),
97119701 },
9712 .solaris, .illumos => 2048,
9702 .illumos => 2048,
97139703 .haiku, .netbsd => 8192,
97149704 .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,
97159705 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L58
......@@ -9719,7 +9709,7 @@ pub const MINSIGSTKSZ = switch (native_os) {
97199709pub const SIGSTKSZ = switch (native_os) {
97209710 .macos, .ios, .tvos, .watchos, .visionos => 131072,
97219711 .netbsd, .freebsd => MINSIGSTKSZ + 32768,
9722 .solaris, .illumos => 8192,
9712 .illumos => 8192,
97239713 .haiku => 16384,
97249714 .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
97259715 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L59
......@@ -9733,7 +9723,7 @@ pub const SS = switch (native_os) {
97339723 pub const DISABLE = 4;
97349724 },
97359725 // 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 {
97379727 pub const ONSTACK = 0x1;
97389728 pub const DISABLE = 0x2;
97399729 },
......@@ -10314,7 +10304,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_
1031410304
1031510305pub const arc4random_buf = switch (native_os) {
1031610306 .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,
1031810308 else => {},
1031910309};
1032010310pub const getentropy = switch (native_os) {
......@@ -10383,7 +10373,7 @@ pub const sigaltstack = switch (native_os) {
1038310373
1038410374pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
1038510375pub 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,
1038710377 else => {},
1038810378};
1038910379pub const copy_file_range = switch (native_os) {
......@@ -10443,12 +10433,12 @@ pub const munlock = switch (native_os) {
1044310433};
1044410434
1044510435pub const mlockall = switch (native_os) {
10446 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.mlockall,
10436 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.mlockall,
1044710437 else => {},
1044810438};
1044910439
1045010440pub const munlockall = switch (native_os) {
10451 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.munlockall,
10441 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.munlockall,
1045210442 else => {},
1045310443};
1045410444
......@@ -10491,7 +10481,7 @@ pub fn sigrtmin() u8 {
1049110481 return switch (native_os) {
1049210482 .freebsd => 65,
1049310483 .netbsd => 33,
10494 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
10484 .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
1049510485 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
1049610486 };
1049710487}
......@@ -10501,7 +10491,7 @@ pub fn sigrtmax() u8 {
1050110491 return switch (native_os) {
1050210492 .freebsd => 126,
1050310493 .netbsd => 63,
10504 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
10494 .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
1050510495 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
1050610496 };
1050710497}
......@@ -10556,11 +10546,11 @@ pub const malloc_usable_size = switch (native_os) {
1055610546 else => {},
1055710547};
1055810548pub 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,
1056010550 else => {},
1056110551};
1056210552pub const sysconf = switch (native_os) {
10563 .solaris => solaris.sysconf,
10553 .illumos => illumos.sysconf,
1056410554 else => private.sysconf,
1056510555};
1056610556
......@@ -10629,7 +10619,6 @@ pub const fork = switch (native_os) {
1062910619 .macos,
1063010620 .netbsd,
1063110621 .openbsd,
10632 .solaris,
1063310622 .illumos,
1063410623 .tvos,
1063510624 .watchos,
......@@ -10777,7 +10766,7 @@ pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_
1077710766pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int;
1077810767pub const pthread_setname_np = switch (native_os) {
1077910768 .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np,
10780 .solaris, .illumos => solaris.pthread_setname_np,
10769 .illumos => illumos.pthread_setname_np,
1078110770 .netbsd => netbsd.pthread_setname_np,
1078210771 else => private.pthread_setname_np,
1078310772};
......@@ -10987,33 +10976,33 @@ pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usi
1098710976// OS-specific bits. These are protected from being used on the wrong OS by
1098810977// comptime assertions inside each OS-specific file.
1098910978
10990pub const AF_SUN = solaris.AF_SUN;
10991pub const AT_SUN = solaris.AT_SUN;
10992pub const FILE_EVENT = solaris.FILE_EVENT;
10993pub const GETCONTEXT = solaris.GETCONTEXT;
10994pub const GETUSTACK = solaris.GETUSTACK;
10995pub const PORT_ALERT = solaris.PORT_ALERT;
10996pub const PORT_SOURCE = solaris.PORT_SOURCE;
10997pub const POSIX_FADV = solaris.POSIX_FADV;
10998pub const SETCONTEXT = solaris.SETCONTEXT;
10999pub const SETUSTACK = solaris.GETUSTACK;
11000pub const SFD = solaris.SFD;
11001pub const ctid_t = solaris.ctid_t;
11002pub const file_obj = solaris.file_obj;
11003pub const id_t = solaris.id_t;
11004pub const lif_ifinfo_req = solaris.lif_ifinfo_req;
11005pub const lif_nd_req = solaris.lif_nd_req;
11006pub const lifreq = solaris.lifreq;
11007pub const major_t = solaris.major_t;
11008pub const minor_t = solaris.minor_t;
11009pub const poolid_t = solaris.poolid_t;
11010pub const port_notify = solaris.port_notify;
11011pub const priority = solaris.priority;
11012pub const procfs = solaris.procfs;
11013pub const projid_t = solaris.projid_t;
11014pub const signalfd_siginfo = solaris.signalfd_siginfo;
11015pub const taskid_t = solaris.taskid_t;
11016pub const zoneid_t = solaris.zoneid_t;
10979pub const AF_SUN = illumos.AF_SUN;
10980pub const AT_SUN = illumos.AT_SUN;
10981pub const FILE_EVENT = illumos.FILE_EVENT;
10982pub const GETCONTEXT = illumos.GETCONTEXT;
10983pub const GETUSTACK = illumos.GETUSTACK;
10984pub const PORT_ALERT = illumos.PORT_ALERT;
10985pub const PORT_SOURCE = illumos.PORT_SOURCE;
10986pub const POSIX_FADV = illumos.POSIX_FADV;
10987pub const SETCONTEXT = illumos.SETCONTEXT;
10988pub const SETUSTACK = illumos.GETUSTACK;
10989pub const SFD = illumos.SFD;
10990pub const ctid_t = illumos.ctid_t;
10991pub const file_obj = illumos.file_obj;
10992pub const id_t = illumos.id_t;
10993pub const lif_ifinfo_req = illumos.lif_ifinfo_req;
10994pub const lif_nd_req = illumos.lif_nd_req;
10995pub const lifreq = illumos.lifreq;
10996pub const major_t = illumos.major_t;
10997pub const minor_t = illumos.minor_t;
10998pub const poolid_t = illumos.poolid_t;
10999pub const port_notify = illumos.port_notify;
11000pub const priority = illumos.priority;
11001pub const procfs = illumos.procfs;
11002pub const projid_t = illumos.projid_t;
11003pub const signalfd_siginfo = illumos.signalfd_siginfo;
11004pub const taskid_t = illumos.taskid_t;
11005pub const zoneid_t = illumos.zoneid_t;
1101711006
1101811007pub const DirEnt = haiku.DirEnt;
1101911008pub const _get_next_area_info = haiku._get_next_area_info;
......@@ -11361,7 +11350,7 @@ const private = struct {
1136111350 extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
1136211351 extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {
1136311352 .freebsd => isize,
11364 .solaris, .illumos => usize,
11353 .illumos => usize,
1136511354 else => c_int,
1136611355 };
1136711356 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 {
6363 .freebsd, .openbsd => return rescanWithPath(cb, gpa, "/etc/ssl/cert.pem"),
6464 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
6565 .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"),
6767 .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"),
6868 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19
6969 .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) {
13681368 .watchos,
13691369
13701370 .illumos,
1371 .solaris,
13721371
13731372 .windows,
13741373 => true,
......@@ -1471,7 +1470,6 @@ fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopa
14711470 .openbsd,
14721471 => @intFromPtr(info.data.fault.addr),
14731472 .illumos,
1474 .solaris,
14751473 => @intFromPtr(info.reason.fault.addr),
14761474 else => comptime unreachable,
14771475 };
lib/std/debug/SelfInfo/Elf.zig-3
......@@ -160,9 +160,6 @@ pub const can_unwind: bool = s: {
160160 .x86,
161161 .x86_64,
162162 },
163 .solaris => &.{
164 .x86_64,
165 },
166163
167164 else => unreachable,
168165 };
lib/std/debug/cpu_context.zig-35
......@@ -961,7 +961,6 @@ const Powerpc = extern struct {
961961 // * System V Application Binary Interface - PowerPC Processor Supplement §3-46
962962 // * Power Architecture 32-bit Application Binary Interface Supplement 1.0 - Linux & Embedded §3.4
963963 // * 64-bit ELF V2 ABI Specification - Power Architecture Revision 1.5 §2.4
964 // * ??? AIX?
965964 //
966965 // Are we having fun yet?
967966
......@@ -1936,40 +1935,6 @@ const signal_ucontext_t = switch (native_os) {
19361935 else => unreachable,
19371936 },
19381937 },
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 },
19731938 // https://github.com/illumos/illumos-gate/blob/d4ce137bba3bd16823db6374d9e9a643264ce245/usr/src/uts/intel/sys/ucontext.h
19741939 .illumos => extern struct {
19751940 _flags: usize,
lib/std/dynamic_library.zig+2-2
......@@ -16,7 +16,7 @@ pub const DynLib = struct {
1616 else
1717 DlDynLib,
1818 .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,
2020 else => struct {
2121 const open = @compileError("unsupported platform");
2222 const openZ = @compileError("unsupported platform");
......@@ -672,7 +672,7 @@ pub const DlDynLib = struct {
672672
673673test "dynamic_library" {
674674 const libname = switch (native_os) {
675 .linux, .freebsd, .openbsd, .solaris, .illumos => "invalid_so.so",
675 .linux, .freebsd, .openbsd, .illumos => "invalid_so.so",
676676 .windows => "invalid_dll.dll",
677677 .macos, .tvos, .watchos, .ios, .visionos => "invalid_dylib.dylib",
678678 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
5151/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with
5252/// no particular encoding.
5353pub 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,
5555 // Each WTF-16LE code unit may be expanded to 3 WTF-8 bytes.
5656 // If it would require 4 WTF-8 bytes, then there would be a surrogate
5757 // 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) {
7272/// On WASI, file name components are encoded as valid UTF-8.
7373/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.
7474pub 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,
7676 // Haiku's NAME_MAX includes the null terminator, so subtract one.
7777 .haiku => posix.NAME_MAX - 1,
7878 // Each WTF-16LE character may be expanded to 3 WTF-8 bytes.
......@@ -571,7 +571,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
571571 error.NetworkNotFound => unreachable, // Windows-only
572572 else => |e| return e,
573573 },
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) {
575575 error.InvalidUtf8 => unreachable, // WASI-only
576576 error.InvalidWtf8 => unreachable, // Windows-only
577577 error.UnsupportedReparsePointType => unreachable, // Windows-only
lib/std/fs/Dir.zig+5-6
......@@ -39,7 +39,7 @@ const IteratorError = error{
3939} || posix.UnexpectedError;
4040
4141pub const Iterator = switch (native_os) {
42 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct {
42 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos => struct {
4343 dir: Dir,
4444 seek: i64,
4545 buf: [1024]u8 align(@alignOf(posix.system.dirent)),
......@@ -57,7 +57,7 @@ pub const Iterator = switch (native_os) {
5757 switch (native_os) {
5858 .macos, .ios => return self.nextDarwin(),
5959 .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(),
60 .solaris, .illumos => return self.nextSolaris(),
60 .illumos => return self.nextIllumos(),
6161 else => @compileError("unimplemented"),
6262 }
6363 }
......@@ -116,7 +116,7 @@ pub const Iterator = switch (native_os) {
116116 }
117117 }
118118
119 fn nextSolaris(self: *Self) !?Entry {
119 fn nextIllumos(self: *Self) !?Entry {
120120 start_over: while (true) {
121121 if (self.index >= self.end_index) {
122122 if (self.first_iter) {
......@@ -144,7 +144,7 @@ pub const Iterator = switch (native_os) {
144144 if (mem.eql(u8, name, ".") or mem.eql(u8, name, ".."))
145145 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.
148148 const stat_info = posix.fstatat(
149149 self.dir.fd,
150150 name,
......@@ -619,7 +619,6 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator {
619619 .netbsd,
620620 .dragonfly,
621621 .openbsd,
622 .solaris,
623622 .illumos,
624623 => return Iterator{
625624 .dir = self,
......@@ -1770,7 +1769,7 @@ pub fn deleteFileZ(self: Dir, sub_path_c: [*:0]const u8) DeleteFileError!void {
17701769 error.AccessDenied, error.PermissionDenied => |e| switch (native_os) {
17711770 // non-Linux POSIX systems return permission errors when trying to delete a
17721771 // 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 => {
17741773 // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them)
17751774 const fstat = posix.fstatatZ(self.fd, sub_path_c, posix.AT.SYMLINK_NOFOLLOW) catch return e;
17761775 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 {
444444 posix.S.IFSOCK => break :k .unix_domain_socket,
445445 else => {},
446446 }
447 if (builtin.os.tag.isSolarish()) switch (m) {
447 if (builtin.os.tag == .illumos) switch (m) {
448448 posix.S.IFDOOR => break :k .door,
449449 posix.S.IFPORT => break :k .event_port,
450450 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
3030 };
3131 return fs.path.join(allocator, &[_][]const u8{ home_dir, "Library", "Application Support", appname });
3232 },
33 .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos, .serenity => {
33 .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos, .serenity => {
3434 if (posix.getenv("XDG_DATA_HOME")) |xdg| {
3535 if (xdg.len > 0) {
3636 return fs.path.join(allocator, &[_][]const u8{ xdg, appname });
lib/std/heap.zig+3-3
......@@ -155,7 +155,7 @@ const CAllocator = struct {
155155 else {};
156156
157157 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,
159159 else => false,
160160 };
161161
......@@ -768,7 +768,7 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) {
768768 .sparc64 => 8 << 10,
769769 else => null,
770770 },
771 .solaris, .illumos => switch (builtin.cpu.arch) {
771 .illumos => switch (builtin.cpu.arch) {
772772 // src/uts/*/sys/machparam.h
773773 .x86, .x86_64 => 4 << 10,
774774 .sparc, .sparc64 => 8 << 10,
......@@ -926,7 +926,7 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) {
926926 .sparc64 => 8 << 10,
927927 else => null,
928928 },
929 .solaris, .illumos => switch (builtin.cpu.arch) {
929 .illumos => switch (builtin.cpu.arch) {
930930 // src/uts/*/sys/machparam.h
931931 .x86, .x86_64 => 4 << 10,
932932 .sparc, .sparc64 => 8 << 10,
lib/std/os.zig+1-2
......@@ -80,7 +80,6 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool {
8080 .tvos,
8181 .visionos,
8282 .linux,
83 .solaris,
8483 .illumos,
8584 .freebsd,
8685 .serenity,
......@@ -147,7 +146,7 @@ pub fn getFdPath(fd: std.posix.fd_t, out_buffer: *[max_path_bytes]u8) std.posix.
147146 };
148147 return target;
149148 },
150 .solaris, .illumos => {
149 .illumos => {
151150 var procfs_buf: ["/proc/self/path/-2147483648\x00".len]u8 = undefined;
152151 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
60356035 switch (errno(system.sigaction(sig, act, oact))) {
60366036 .SUCCESS => return,
60376037 // 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 the
6038 // changed. For POSIX, this means SIGKILL/SIGSTOP. For e.g. illumos, this also includes the
60396039 // non-standard SIGWAITING, SIGCANCEL, and SIGLWP. Either way, programmer error.
60406040 .INVAL => unreachable,
60416041 else => unreachable,
......@@ -7414,7 +7414,6 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, data: usize) PtraceError!vo
74147414 .wasi,
74157415 .emscripten,
74167416 .haiku,
7417 .solaris,
74187417 .illumos,
74197418 .plan9,
74207419 => @compileError("ptrace unsupported by target OS"),
lib/std/posix/test.zig+4-4
......@@ -186,7 +186,7 @@ test "linkat with different directories" {
186186 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // `nstat.nlink` assertion is failing with LLVM 20+ for unclear reasons.
187187
188188 switch (native_os) {
189 .wasi, .linux, .solaris, .illumos => {},
189 .wasi, .linux, .illumos => {},
190190 else => return error.SkipZigTest,
191191 }
192192
......@@ -558,7 +558,7 @@ test "fcntl" {
558558
559559test "signalfd" {
560560 switch (native_os) {
561 .linux, .solaris, .illumos => {},
561 .linux, .illumos => {},
562562 else => return error.SkipZigTest,
563563 }
564564 _ = &posix.signalfd;
......@@ -577,7 +577,7 @@ test "sync" {
577577
578578test "fsync" {
579579 switch (native_os) {
580 .linux, .windows, .solaris, .illumos => {},
580 .linux, .windows, .illumos => {},
581581 else => return error.SkipZigTest,
582582 }
583583
......@@ -708,7 +708,7 @@ test "sigset add/del" {
708708
709709test "dup & dup2" {
710710 switch (native_os) {
711 .linux, .solaris, .illumos => {},
711 .linux, .illumos => {},
712712 else => return error.SkipZigTest,
713713 }
714714
lib/std/process.zig-1
......@@ -1539,7 +1539,6 @@ pub fn getUserInfo(name: []const u8) !UserInfo {
15391539 .netbsd,
15401540 .openbsd,
15411541 .haiku,
1542 .solaris,
15431542 .illumos,
15441543 .serenity,
15451544 => posixGetUserInfo(name),
lib/std/start.zig+1-1
......@@ -761,7 +761,7 @@ fn maybeIgnoreSigpipe() void {
761761 const have_sigpipe_support = switch (builtin.os.tag) {
762762 .linux,
763763 .plan9,
764 .solaris,
764 .illumos,
765765 .netbsd,
766766 .openbsd,
767767 .haiku,
lib/std/zig/LibCInstallation.zig+2-2
......@@ -198,7 +198,7 @@ pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {
198198 try self.findNativeIncludeDirPosix(args);
199199 try self.findNativeGccDirHaiku(args);
200200 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) {
202202 // There is only one libc, and its headers/libraries are always in the same spot.
203203 self.include_dir = try args.allocator.dupeZ(u8, "/usr/include");
204204 self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include");
......@@ -935,7 +935,7 @@ pub const CrtBasenames = struct {
935935 .crtn = "crtn.o",
936936 },
937937 },
938 .solaris, .illumos => switch (mode) {
938 .illumos => switch (mode) {
939939 .dynamic_lib => .{
940940 .crti = "crti.o",
941941 .crtn = "crtn.o",
lib/std/zig/system.zig+4-4
......@@ -228,7 +228,7 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target {
228228 error.InvalidVersion => {},
229229 }
230230 },
231 .solaris, .illumos => {
231 .illumos => {
232232 const uts = posix.uname();
233233 const release = mem.sliceTo(&uts.release, 0);
234234 if (std.SemanticVersion.parse(release)) |ver| {
......@@ -1058,13 +1058,13 @@ fn detectAbiAndDynamicLinker(
10581058) DetectError!Target {
10591059 const native_target_has_ld = comptime Target.DynamicLinker.kind(builtin.os.tag) != .none;
10601060 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;
10621062 const is_darwin = builtin.target.os.tag.isDarwin();
10631063 const have_all_info = query.dynamic_linker.get() != null and
10641064 query.abi != null and (!is_linux or query.abi.?.isGnu());
10651065 const os_is_non_native = query.os_tag != null;
1066 // The Solaris/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) {
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_illumos or is_darwin) {
10681068 return defaultAbiAndDynamicLinker(cpu, os, query);
10691069 }
10701070 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 {
9999 return self;
100100 }
101101
102 if (builtin.os.tag.isSolarish()) {
102 if (builtin.os.tag == .illumos) {
103103 try self.addLibDir("/usr/lib/64");
104104 try self.addLibDir("/usr/local/lib/64");
105105 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
211211 .linux => "linux",
212212 .netbsd => "netbsd",
213213 .openbsd => "openbsd",
214 .solaris, .illumos => "solaris",
214 .illumos => "solaris",
215215 .windows, .uefi => "windows",
216216 .zos => "zos",
217217 .haiku => "haiku",
src/link/Elf.zig+1-1
......@@ -1561,7 +1561,7 @@ pub fn writeElfHeader(self: *Elf) !void {
15611561 else => switch (target.os.tag) {
15621562 .freebsd, .ps4 => .FREEBSD,
15631563 .hermit => .STANDALONE,
1564 .illumos, .solaris => .SOLARIS,
1564 .illumos => .SOLARIS,
15651565 .openbsd => .OPENBSD,
15661566 else => .NONE,
15671567 },
src/link/Elf2.zig+1-1
......@@ -417,7 +417,7 @@ fn create(
417417 else => .NONE,
418418 .freestanding, .other => .STANDALONE,
419419 .netbsd => .NETBSD,
420 .solaris => .SOLARIS,
420 .illumos => .SOLARIS,
421421 .aix => .AIX,
422422 .freebsd => .FREEBSD,
423423 .cuda => .CUDA,
src/target.zig+4-5
......@@ -129,13 +129,13 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.builtin.Compil
129129 else => false,
130130 },
131131 .x86 => switch (target.os.tag) {
132 .linux, .freebsd, .solaris, .illumos => true,
132 .linux, .freebsd, .illumos => true,
133133 .windows => !ofmt_c_msvc,
134134 else => false,
135135 },
136136 .x86_64 => switch (target.os.tag) {
137137 .linux => target.abi != .gnux32 and target.abi != .muslx32,
138 .freebsd, .solaris, .illumos => true,
138 .freebsd, .illumos => true,
139139 .windows => !ofmt_c_msvc,
140140 else => false,
141141 },
......@@ -257,7 +257,7 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C
257257pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
258258 if (target.cpu.arch.isSpirV()) return true;
259259 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
260 if (target.os.tag.isSolarish()) {
260 if (target.os.tag == .illumos) {
261261 // https://github.com/ziglang/zig/issues/25699
262262 return false;
263263 }
......@@ -428,8 +428,7 @@ pub fn libcFullLinkFlags(target: *const std.Target) []const []const u8 {
428428 // c compilers such as gcc or clang use.
429429 const result: []const []const u8 = switch (target.os.tag) {
430430 .dragonfly, .freebsd, .netbsd, .openbsd => &.{ "-lm", "-lpthread", "-lc", "-lutil" },
431 // Solaris releases after 10 merged the threading libraries into libc.
432 .solaris, .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" },
431 .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" },
433432 .haiku => &.{ "-lm", "-lroot", "-lpthread", "-lc", "-lnetwork" },
434433 .linux => switch (target.abi) {
435434 .android, .androideabi, .ohos, .ohoseabi => &.{ "-lm", "-lc", "-ldl" },
test/llvm_targets.zig-2
......@@ -254,7 +254,6 @@ const targets = [_]std.Target.Query{
254254 .{ .cpu_arch = .sparc64, .os_tag = .netbsd, .abi = .none },
255255 .{ .cpu_arch = .sparc64, .os_tag = .openbsd, .abi = .none },
256256 .{ .cpu_arch = .sparc64, .os_tag = .rtems, .abi = .none },
257 .{ .cpu_arch = .sparc64, .os_tag = .solaris, .abi = .none },
258257
259258 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },
260259 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },
......@@ -338,7 +337,6 @@ const targets = [_]std.Target.Query{
338337 .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none },
339338 .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none },
340339 .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none },
341 .{ .cpu_arch = .x86_64, .os_tag = .solaris, .abi = .none },
342340 .{ .cpu_arch = .x86_64, .os_tag = .tvos, .abi = .simulator },
343341 .{ .cpu_arch = .x86_64, .os_tag = .uefi, .abi = .none },
344342 .{ .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 {
4141fn shouldTestNonLlvm(target: *const std.Target) bool {
4242 return switch (target.cpu.arch) {
4343 .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,
4545 else => false,
4646 },
4747 else => false,
test/src/StackTrace.zig+1-1
......@@ -46,7 +46,7 @@ fn addCaseTarget(
4646) void {
4747 const both_backends = switch (target.result.cpu.arch) {
4848 .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,
5050 else => false,
5151 },
5252 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 {
5050
5151fn test_link(tmp: std.testing.TmpDir) !void {
5252 switch (builtin.target.os.tag) {
53 .linux, .solaris, .illumos => {},
53 .linux, .illumos => {},
5454 else => return,
5555 }
5656
test/tests.zig+1-1
......@@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
24932493 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
24942494 const os_tag = query.os_tag orelse builtin.os.tag;
24952495 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,
24972497 .spirv32, .spirv64 => return false,
24982498 else => return true,
24992499 }