diff --git a/CMakeLists.txt b/CMakeLists.txt index 690e2e35b1b6f3b4286f70864b3a2b05eb2b6ba3..6efe4e749000c77bf009be6404f014ba416222c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -738,17 +738,12 @@ string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS) if(ZIG_HOST_TARGET_OS STREQUAL "darwin") set(ZIG_HOST_TARGET_OS "macos") elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos") - check_symbol_exists(__illumos__ "" ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO) - if (ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO) - set(ZIG_HOST_TARGET_OS "illumos") - else() - set(ZIG_HOST_TARGET_OS "solaris") - endif() + set(ZIG_HOST_TARGET_OS "illumos") endif() string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH) if(ZIG_HOST_TARGET_ARCH MATCHES "^i[3-9]86$") - if (ZIG_HOST_TARGET_OS MATCHES "(solaris|illumos)") + if (ZIG_HOST_TARGET_OS STREQUAL "illumos") set(ZIG_HOST_TARGET_ARCH "x86_64") else() set(ZIG_HOST_TARGET_ARCH "x86") diff --git a/build.zig b/build.zig index c4a1d2f3adf54c49dd4cc3937bdcb6a7018a72de..40b74b94b47e7810eb9939d1569e3db11b659142 100644 --- a/build.zig +++ b/build.zig @@ -818,7 +818,7 @@ fn addCmakeCfgOptionsToExe( try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); }, - .solaris, .illumos => { + .illumos => { try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); }, diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig index a31ff7ef7074f62fa85719645c3c7d6838e5780b..fea2ba2a6207862b2dc10369daa0340d10bfa5c4 100644 --- a/lib/compiler/aro/aro/Compilation.zig +++ b/lib/compiler/aro/aro/Compilation.zig @@ -337,7 +337,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { .netbsd => try define(w, "__NetBSD__"), .openbsd => try define(w, "__OpenBSD__"), .dragonfly => try define(w, "__DragonFly__"), - .solaris => try defineStd(w, "sun", is_gnu), + .illumos => try defineStd(w, "sun", is_gnu), .macos, .tvos, .ios, @@ -361,7 +361,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { .linux, .haiku, .hurd, - .solaris, + .illumos, .aix, .emscripten, .ps4, @@ -618,7 +618,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { try defineStd(w, "sparc", is_gnu); try define(w, "__sparc_v9__"); try define(w, "__arch64__"); - if (comp.target.os.tag != .solaris) { + if (comp.target.os.tag != .illumos) { try define(w, "__sparc64__"); try define(w, "__sparc_v9__"); try define(w, "__sparcv9__"); @@ -626,7 +626,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { }, .sparc => { try defineStd(w, "sparc", is_gnu); - if (comp.target.os.tag == .solaris) { + if (comp.target.os.tag == .illumos) { try define(w, "__sparcv8"); } }, diff --git a/lib/compiler/aro/aro/Toolchain.zig b/lib/compiler/aro/aro/Toolchain.zig index 75c04d72158ccceee5eac7058701d05143e9cba9..23e8d929b9e194225ad3d178f50d77f43f7b17fa 100644 --- a/lib/compiler/aro/aro/Toolchain.zig +++ b/lib/compiler/aro/aro/Toolchain.zig @@ -391,8 +391,8 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind { } } -fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 { - if (is_solaris) { +fn getAsNeededOption(is_illumos: bool, needed: bool) []const u8 { + if (is_illumos) { return if (needed) "-zignore" else "-zrecord"; } else { return if (needed) "--as-needed" else "--no-as-needed"; @@ -412,7 +412,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3); if (as_needed) { - argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true)); + argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, true)); } switch (unw) { .none => return, @@ -435,7 +435,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi } if (as_needed) { - argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false)); + argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, false)); } } diff --git a/lib/compiler/aro/aro/target.zig b/lib/compiler/aro/aro/target.zig index 0c17e816f8ad59c34140a5edbe0e320bf8f30b6b..080e99d6dfc605291621ee7bfd35c0cf5ff1ec21 100644 --- a/lib/compiler/aro/aro/target.zig +++ b/lib/compiler/aro/aro/target.zig @@ -252,7 +252,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler { target.abi.isAndroid() or target.os.tag.isBSD() or target.os.tag == .fuchsia or - target.os.tag == .solaris or + target.os.tag == .illumos or target.os.tag == .haiku or target.cpu.arch == .hexagon) { @@ -281,7 +281,7 @@ pub fn hasFloat128(target: std.Target) bool { .haiku, .linux, .openbsd, - .solaris, + .illumos, => target.cpu.arch.isX86(), else => false, }; @@ -654,8 +654,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { .ps3 => "lv2", .netbsd => "netbsd", .openbsd => "openbsd", - .solaris => "solaris", - .illumos => "illumos", + .illumos => "solaris", .windows => "windows", .zos => "zos", .haiku => "haiku", @@ -755,7 +754,7 @@ pub fn isPIEDefault(target: std.Target) DefaultPIStatus { .dragonfly, .netbsd, .freebsd, - .solaris, + .illumos, .cuda, .amdhsa, @@ -838,7 +837,7 @@ pub fn isPICdefault(target: std.Target) DefaultPIStatus { .openbsd, .netbsd, .freebsd, - .solaris, + .illumos, .hurd, => { return switch (target.cpu.arch) { @@ -897,7 +896,7 @@ pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus { .openbsd, .netbsd, .freebsd, - .solaris, + .illumos, .cuda, .ps4, .ps5, diff --git a/lib/std/Progress.zig b/lib/std/Progress.zig index 060ba085b682265420db31413ffd73dec42d7649..fb06fca2e9b20af8b5c5bbec4e40dd460fb38735 100644 --- a/lib/std/Progress.zig +++ b/lib/std/Progress.zig @@ -1547,7 +1547,7 @@ fn handleSigWinch(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopaque) const have_sigwinch = switch (builtin.os.tag) { .linux, .plan9, - .solaris, + .illumos, .netbsd, .openbsd, .haiku, diff --git a/lib/std/Target.zig b/lib/std/Target.zig index fbb931357d91cd5fa9d0fbe7ac7c9239358b5ff5..8bfd029be45a19cd4c8b6c911f010f6d187abe63 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -27,6 +27,7 @@ pub const Os = struct { aix, haiku, hurd, + illumos, linux, plan9, rtems, @@ -45,9 +46,6 @@ pub const Os = struct { visionos, watchos, - illumos, - solaris, - windows, uefi, @@ -98,10 +96,6 @@ pub const Os = struct { }; } - pub inline fn isSolarish(tag: Tag) bool { - return tag == .solaris or tag == .illumos; - } - pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 { return switch (tag) { .windows => ".exe", @@ -163,11 +157,10 @@ pub const Os = struct { .managarm, .haiku, + .illumos, .plan9, .serenity, - .illumos, - .ps3, .ps4, .ps5, @@ -197,8 +190,6 @@ pub const Os = struct { .visionos, .watchos, - .solaris, - .uefi, .@"3ds", @@ -395,11 +386,10 @@ pub const Os = struct { .managarm, .haiku, + .illumos, .plan9, .serenity, - .illumos, - .ps3, .ps4, .ps5, @@ -597,13 +587,6 @@ pub const Os = struct { }, }, - .solaris => .{ - .semver = .{ - .min = .{ .major = 11, .minor = 0, .patch = 0 }, - .max = .{ .major = 11, .minor = 4, .patch = 0 }, - }, - }, - .windows => .{ .windows = .{ .min = .win10, @@ -930,6 +913,7 @@ pub const Abi = enum { .contiki, .fuchsia, .hermit, + .illumos, .managarm, .plan9, .serenity, @@ -937,8 +921,6 @@ pub const Abi = enum { .dragonfly, .driverkit, .macos, - .illumos, - .solaris, .ps3, .ps4, .ps5, @@ -2043,10 +2025,6 @@ pub const Cpu = struct { else => &s390x.cpu.arch8, }, .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8. - .sparc64 => switch (os.tag) { - .solaris => &sparc.cpu.ultrasparc3, - else => generic(arch), - }, .x86 => &x86.cpu.pentium4, .x86_64 => switch (os.tag) { .driverkit => &x86.cpu.nehalem, @@ -2175,6 +2153,7 @@ pub inline fn isWasiLibC(target: *const Target) bool { pub fn requiresLibC(target: *const Target) bool { return switch (target.os.tag) { .aix, + .illumos, .driverkit, .macos, .ios, @@ -2184,8 +2163,6 @@ pub fn requiresLibC(target: *const Target) bool { .dragonfly, .openbsd, .haiku, - .solaris, - .illumos, .serenity, => true, @@ -2332,6 +2309,7 @@ pub const DynamicLinker = struct { .fuchsia, .haiku, + .illumos, .serenity, .dragonfly, @@ -2345,9 +2323,6 @@ pub const DynamicLinker = struct { .tvos, .visionos, .watchos, - - .illumos, - .solaris, => .arch_os, .hurd, .linux, @@ -2439,6 +2414,14 @@ pub const DynamicLinker = struct { else => none, }, + .illumos, + => switch (cpu.arch) { + .x86, + .x86_64, + => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}), + else => none, + }, + .linux => if (abi.isAndroid()) switch (cpu.arch) { .arm => if (abi == .androideabi) init("/system/bin/linker") else none, @@ -2755,22 +2738,6 @@ pub const DynamicLinker = struct { else => none, }, - .illumos, - => switch (cpu.arch) { - .x86, - .x86_64, - => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}), - else => none, - }, - - .solaris, - => switch (cpu.arch) { - .sparc64, - .x86_64, - => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}), - else => none, - }, - // Operating systems in this list have been verified as not having a standard // dynamic linker path. .freestanding, @@ -3134,6 +3101,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { .aix, .haiku, .hurd, + .illumos, .linux, .plan9, .rtems, @@ -3145,9 +3113,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { .netbsd, .openbsd, - .illumos, - .solaris, - .wasi, .emscripten, => switch (target.cpu.arch) { diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index dfefeceea02a23a1ec5f99999de53be7622405d3..f587b15f86121833a3ab2c5fb2fa30f19f8400b8 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -120,7 +120,7 @@ pub const max_name_len = switch (native_os) { .freebsd => 15, .openbsd => 23, .dragonfly => 1023, - .solaris, .illumos => 31, + .illumos => 31, // https://github.com/SerenityOS/serenity/blob/6b4c300353da49d3508b5442cf61da70bd04d757/Kernel/Tasks/Thread.h#L102 .serenity => 63, else => 0, @@ -211,7 +211,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { else => |e| return posix.unexpectedErrno(e), } }, - .netbsd, .solaris, .illumos => if (use_pthreads) { + .netbsd, .illumos => if (use_pthreads) { const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null); switch (@as(posix.E, @enumFromInt(err))) { .SUCCESS => return, @@ -324,7 +324,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co else => |e| return posix.unexpectedErrno(e), } }, - .netbsd, .solaris, .illumos => if (use_pthreads) { + .netbsd, .illumos => if (use_pthreads) { const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); switch (@as(posix.E, @enumFromInt(err))) { .SUCCESS => return std.mem.sliceTo(buffer, 0), @@ -739,10 +739,10 @@ const PosixThreadImpl = struct { }; return @as(usize, @intCast(count)); }, - .solaris, .illumos, .serenity => { + .illumos, .serenity => { // The "proper" way to get the cpu count would be to query // /dev/kstat via ioctls, and traverse a linked list for each - // cpu. (solaris, illumos) + // cpu. (illumos) const rc = c.sysconf(@intFromEnum(std.c._SC.NPROCESSORS_ONLN)); return switch (posix.errno(rc)) { .SUCCESS => @as(usize, @intCast(rc)), diff --git a/lib/std/c.zig b/lib/std/c.zig index cc7bd17cb06db99ca186c760d500584f3623a143..30e584c1a1cc2980e569d4f6a42715f2e60c5cba 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -14,7 +14,7 @@ const windows = std.os.windows; const ws2_32 = std.os.windows.ws2_32; const darwin = @import("c/darwin.zig"); const freebsd = @import("c/freebsd.zig"); -const solaris = @import("c/solaris.zig"); +const illumos = @import("c/illumos.zig"); const netbsd = @import("c/netbsd.zig"); const dragonfly = @import("c/dragonfly.zig"); const haiku = @import("c/haiku.zig"); @@ -117,7 +117,7 @@ pub const timespec = switch (native_os) { sec: isize, nsec: isize, }, - .netbsd, .solaris, .illumos => extern struct { + .netbsd, .illumos => extern struct { sec: i64, nsec: isize, }, @@ -132,7 +132,7 @@ pub const dev_t = switch (native_os) { .linux => linux.dev_t, .emscripten => emscripten.dev_t, .wasi => wasi.device_t, - .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32, + .openbsd, .haiku, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32, // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L43 .netbsd, .freebsd, .serenity => u64, else => void, @@ -141,7 +141,7 @@ pub const dev_t = switch (native_os) { pub const mode_t = switch (native_os) { .linux => linux.mode_t, .emscripten => emscripten.mode_t, - .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi, .windows => u32, + .openbsd, .haiku, .netbsd, .illumos, .wasi, .windows => u32, // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L44 .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly, .serenity => u16, else => u0, @@ -153,7 +153,7 @@ pub const nlink_t = switch (native_os) { .wasi => c_ulonglong, // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L45 .freebsd, .serenity => u64, - .openbsd, .netbsd, .solaris, .illumos => u32, + .openbsd, .netbsd, .illumos => u32, .haiku => i32, else => void, }; @@ -310,7 +310,7 @@ pub const clockid_t = switch (native_os) { THREAD_CPUTIME_ID = 14, PROCESS_CPUTIME_ID = 15, }, - .solaris, .illumos => enum(u32) { + .illumos => enum(u32) { VIRTUAL = 1, THREAD_CPUTIME_ID = 2, REALTIME = 3, @@ -457,7 +457,7 @@ pub const E = switch (native_os) { }, .macos, .ios, .tvos, .watchos, .visionos => darwin.E, .freebsd => freebsd.E, - .solaris, .illumos => enum(u16) { + .illumos => enum(u16) { /// No error occurred. SUCCESS = 0, /// Not super-user @@ -1002,7 +1002,7 @@ pub const F = switch (native_os) { pub const GETOWNER_UIDS = 17; }, - .solaris, .illumos => struct { + .illumos => struct { /// Unlock a previously locked region pub const ULOCK = 0; /// Lock a region for exclusive use @@ -1263,7 +1263,7 @@ pub const Flock = switch (native_os) { /// Remote system id or zero for local. sysid: i32, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { type: c_short, whence: c_short, start: off_t, @@ -1293,7 +1293,7 @@ pub const Flock = switch (native_os) { pub const HOST_NAME_MAX = switch (native_os) { .linux => linux.HOST_NAME_MAX, .macos, .ios, .tvos, .watchos, .visionos => 72, - .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255, + .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => 255, // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L22 .serenity => 64, else => {}, @@ -1302,7 +1302,7 @@ pub const IOV_MAX = switch (native_os) { .linux => linux.IOV_MAX, .emscripten => emscripten.IOV_MAX, // https://github.com/SerenityOS/serenity/blob/098af0f846a87b651731780ff48420205fd33754/Kernel/API/POSIX/sys/uio.h#L16 - .openbsd, .haiku, .solaris, .illumos, .wasi, .serenity => 1024, + .openbsd, .haiku, .illumos, .wasi, .serenity => 1024, .macos, .ios, .tvos, .watchos, .visionos => 16, .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX, else => {}, @@ -1549,7 +1549,7 @@ pub const MADV = switch (native_os) { pub const CORE = 9; pub const PROTECT = 10; }, - .solaris, .illumos => struct { + .illumos => struct { /// no further special treatment pub const NORMAL = 0; /// expect random page references @@ -1605,9 +1605,8 @@ pub const MCL = switch (native_os) { // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/088552723935447397400336f5ddb7aa5f5de660/sys/sys/mman.h#L118 // https://github.com/NetBSD/src/blob/fd2741deca927c18e3ba15acdf78b8b14b2abe36/sys/sys/mman.h#L179 // https://github.com/openbsd/src/blob/39404228f6d36c0ca4be5f04ab5385568ebd6aa3/sys/sys/mman.h#L129 - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/mman.h#L379 // https://github.com/illumos/illumos-gate/blob/5280477614f83fea20fc938729df6adb3e44340d/usr/src/uts/common/sys/mman.h#L343 - .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => packed struct(c_int) { + .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => packed struct(c_int) { CURRENT: bool = 0, FUTURE: bool = 0, _: std.meta.Int(.unsigned, @bitSizeOf(c_int) - 2) = 0, @@ -1630,7 +1629,7 @@ pub const MSF = switch (native_os) { pub const DEACTIVATE = 0x8; pub const SYNC = 0x10; }, - .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct { + .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => struct { pub const ASYNC = 1; pub const INVALIDATE = 2; pub const SYNC = 4; @@ -1650,7 +1649,7 @@ pub const NAME_MAX = switch (native_os) { // character, but POSIX definition says that NAME_MAX does not include the // terminating null. // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L20 - .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 255, + .haiku, .openbsd, .dragonfly, .netbsd, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 255, else => {}, }; pub const PATH_MAX = switch (native_os) { @@ -1658,7 +1657,7 @@ pub const PATH_MAX = switch (native_os) { .emscripten => emscripten.PATH_MAX, .wasi => 4096, .windows => 260, - .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 1024, + .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 1024, else => {}, }; @@ -1721,7 +1720,7 @@ pub const POLL = switch (native_os) { pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL; }, - .solaris, .illumos => struct { + .illumos => struct { pub const IN = 0x0001; pub const PRI = 0x0002; pub const OUT = 0x0004; @@ -1812,7 +1811,7 @@ pub const PROT = switch (native_os) { .linux => linux.PROT, .emscripten => emscripten.PROT, // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L28-L31 - .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .windows, .serenity => struct { + .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .windows, .serenity => struct { /// page can not be accessed pub const NONE = 0x0; /// page can be read @@ -1852,7 +1851,7 @@ pub const RLIM = switch (native_os) { pub const SAVED_MAX = INFINITY; pub const SAVED_CUR = INFINITY; }, - .solaris, .illumos => struct { + .illumos => struct { /// No limit pub const INFINITY: rlim_t = (1 << 63) - 3; pub const SAVED_MAX: rlim_t = (1 << 63) - 2; @@ -2022,7 +2021,7 @@ pub const S = switch (native_os) { return m & IFMT == IFWHT; } }, - .solaris, .illumos => struct { + .illumos => struct { pub const IFMT = 0o170000; pub const IFIFO = 0o010000; @@ -2424,7 +2423,7 @@ pub const SA = switch (native_os) { pub const NOCLDWAIT = 0x0020; pub const SIGINFO = 0x0040; }, - .solaris, .illumos => struct { + .illumos => struct { pub const ONSTACK = 0x00000001; pub const RESETHAND = 0x00000002; pub const RESTART = 0x00000004; @@ -2485,7 +2484,7 @@ pub const SA = switch (native_os) { else => void, }; pub const sigval_t = switch (native_os) { - .netbsd, .solaris, .illumos => extern union { + .netbsd, .illumos => extern union { int: i32, ptr: ?*anyopaque, }, @@ -2525,7 +2524,7 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) { .openbsd => enum(c_int) { PAGESIZE = 28, }, - .solaris, .illumos => enum(c_int) { + .illumos => enum(c_int) { PAGESIZE = 11, NPROCESSORS_ONLN = 15, SIGRT_MIN = 40, @@ -2566,7 +2565,7 @@ pub const SEEK = switch (native_os) { pub const CUR = 1; pub const END = 2; }, - .dragonfly, .solaris, .illumos => struct { + .dragonfly, .illumos => struct { pub const SET = 0; pub const CUR = 1; pub const END = 2; @@ -2765,7 +2764,7 @@ pub const SIG = switch (native_os) { return sig <= MAXSIG and sig > 0; } }, - .solaris, .illumos => struct { + .illumos => struct { pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0); pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize)); pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1); @@ -3089,7 +3088,7 @@ pub const SIG = switch (native_os) { pub const SIOCGIFINDEX = switch (native_os) { .linux => linux.SIOCGIFINDEX, .emscripten => emscripten.SIOCGIFINDEX, - .solaris, .illumos => solaris.SIOCGLIFINDEX, + .illumos => illumos.SIOCGLIFINDEX, // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L118 .serenity => 34, else => void, @@ -3204,7 +3203,7 @@ pub const Sigaction = switch (native_os) { /// signal mask to apply mask: sigset_t, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { pub const handler_fn = *align(1) const fn (i32) callconv(.c) void; pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void; @@ -3301,7 +3300,7 @@ pub const T = switch (native_os) { pub const IOCGPTN = 0x4004740f; pub const IOCSIG = 0x2004745f; }, - .solaris, .illumos => struct { + .illumos => struct { pub const CGETA = tioc('T', 1); pub const CSETA = tioc('T', 2); pub const CSETAW = tioc('T', 3); @@ -3731,7 +3730,7 @@ pub const W = switch (native_os) { return (s & 0xffff) -% 1 < 0xff; } }, - .solaris, .illumos => struct { + .illumos => struct { pub const EXITED = 0o001; pub const TRAPPED = 0o002; pub const UNTRACED = 0o004; @@ -3944,7 +3943,7 @@ pub const clock_t = switch (native_os) { .emscripten => emscripten.clock_t, .macos, .ios, .tvos, .watchos, .visionos => c_ulong, .freebsd => isize, - .openbsd, .solaris, .illumos => i64, + .openbsd, .illumos => i64, .netbsd => u32, .haiku => i32, // 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) { tls_modid: usize, tls_data: ?*anyopaque, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { addr: std.elf.Addr, name: ?[*:0]const u8, phdr: [*]std.elf.Phdr, @@ -4001,7 +4000,7 @@ pub const epoll_event = switch (native_os) { pub const ifreq = switch (native_os) { .linux => linux.ifreq, .emscripten => emscripten.ifreq, - .solaris, .illumos => lifreq, + .illumos => lifreq, // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L49-L82 .serenity => extern struct { // Not actually in a union, but the stdlib expects one for ifreq @@ -4026,10 +4025,9 @@ pub const ifreq = switch (native_os) { }; pub const in_pktinfo = switch (native_os) { .linux => linux.in_pktinfo, - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/netinet/in.h#L1084 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1132 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet/in.h#L696 - .solaris, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos => extern struct { + .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos => extern struct { ifindex: u32, spec_dst: u32, addr: u32, @@ -4042,12 +4040,11 @@ pub const in6_pktinfo = switch (native_os) { // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/netinet6/in6.h#L575 // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/netinet6/in6.h#L468 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/netinet6/in6.h#L365 - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/netinet/in.h#L1093 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L114IP1 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet6/in6.h#L737 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/netinet6/in6.h#L63 // https://github.com/SerenityOS/serenity/blob/5bd8af99be0bc4b2e14f361fd7d7590e6bcfa4d6/Kernel/API/POSIX/sys/socket.h#L122 - .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos, .haiku, .serenity => extern struct { + .freebsd, .dragonfly, .netbsd, .openbsd, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos, .haiku, .serenity => extern struct { addr: [16]u8, ifindex: u32, }, @@ -4071,8 +4068,6 @@ pub const linger = switch (native_os) { .netbsd, // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/sys/socket.h#L126 .openbsd, - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L214 - .solaris, // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/sys/socket.h#L250 .illumos, // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/sys/socket.h#L87 @@ -4100,7 +4095,6 @@ pub const msghdr = switch (native_os) { .freebsd, .netbsd, .haiku, - .solaris, .illumos, .macos, .driverkit, @@ -4144,7 +4138,6 @@ pub const msghdr_const = switch (native_os) { .freebsd, .netbsd, .haiku, - .solaris, .illumos, .macos, .driverkit, @@ -4190,8 +4183,6 @@ pub const cmsghdr = switch (native_os) { .netbsd, // https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L527 .openbsd, - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L416 - .solaris, // https://github.com/illumos/illumos-gate/blob/afdf2e523873cb523df379676067bf9785a0f456/usr/src/uts/common/sys/socket.h#L460 .illumos, // https://github.com/SerenityOS/serenity/blob/4ee360a348a5e2490eeaeeabb3eb19e70dd450eb/Kernel/API/POSIX/sys/socket.h#L68 @@ -4215,7 +4206,7 @@ pub const cmsghdr = switch (native_os) { pub const nfds_t = switch (native_os) { .linux => linux.nfds_t, .emscripten => emscripten.nfds_t, - .haiku, .solaris, .illumos, .wasi => usize, + .haiku, .illumos, .wasi => usize, .windows => c_ulong, .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32, // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L32 @@ -4253,7 +4244,7 @@ pub const pollfd = switch (native_os) { pub const rlim_t = switch (native_os) { .linux => linux.rlim_t, .emscripten => emscripten.rlim_t, - .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64, + .openbsd, .netbsd, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64, .haiku, .dragonfly, .freebsd => i64, // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L54 .serenity => usize, @@ -4307,7 +4298,7 @@ pub const rlimit_resource = switch (native_os) { pub const AS: rlimit_resource = .VMEM; }, - .solaris, .illumos => enum(c_int) { + .illumos => enum(c_int) { CPU = 0, FSIZE = 1, DATA = 2, @@ -4401,7 +4392,7 @@ pub const rusage = switch (native_os) { pub const SELF = 0; pub const CHILDREN = -1; }, - .solaris, .illumos => extern struct { + .illumos => extern struct { utime: timeval, stime: timeval, maxrss: isize, @@ -4510,7 +4501,7 @@ pub const siginfo_t = switch (native_os) { }, }, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { signo: c_int, code: c_int, errno: c_int, @@ -4530,8 +4521,8 @@ pub const siginfo_t = switch (native_os) { stime: clock_t, }, }, - contract: solaris.ctid_t, - zone: solaris.zoneid_t, + contract: illumos.ctid_t, + zone: illumos.zoneid_t, }, fault: extern struct { addr: *allowzero anyopaque, @@ -4642,7 +4633,7 @@ pub const sigset_t = switch (native_os) { // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L19 .openbsd, .serenity => u32, .macos, .ios, .tvos, .watchos, .visionos => darwin.sigset_t, - .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct { + .dragonfly, .netbsd, .illumos, .freebsd => extern struct { __bits: [SIG.WORDS]u32, }, .haiku => u64, @@ -4681,7 +4672,7 @@ pub const addrinfo = if (builtin.abi.isAndroid()) extern struct { addr: ?*sockaddr, next: ?*addrinfo, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { flags: AI, family: i32, socktype: i32, @@ -4819,7 +4810,7 @@ pub const sockaddr = switch (native_os) { path: [104]u8, }; }, - .solaris, .illumos => extern struct { + .illumos => extern struct { /// address family family: sa_family_t, @@ -5081,7 +5072,7 @@ pub const sa_family_t = switch (native_os) { .windows => ws2_32.ADDRESS_FAMILY, .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8, // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L66 - .solaris, .illumos, .serenity => u16, + .illumos, .serenity => u16, else => void, }; pub const AF = if (builtin.abi.isAndroid()) struct { @@ -5219,7 +5210,7 @@ pub const AF = if (builtin.abi.isAndroid()) struct { pub const INET6_SDP = 42; pub const MAX = 42; }, - .solaris, .illumos => struct { + .illumos => struct { pub const UNSPEC = 0; pub const UNIX = 1; pub const LOCAL = UNIX; @@ -5499,7 +5490,7 @@ pub const PF = if (builtin.abi.isAndroid()) struct { pub const INET6_SDP = AF.INET6_SDP; pub const MAX = AF.MAX; }, - .solaris, .illumos => struct { + .illumos => struct { pub const UNSPEC = AF.UNSPEC; pub const UNIX = AF.UNIX; pub const LOCAL = UNIX; @@ -5778,7 +5769,7 @@ pub const MSG = switch (native_os) { pub const FBLOCKING = 0x10000; pub const FNONBLOCKING = 0x20000; }, - .solaris, .illumos => struct { + .illumos => struct { pub const OOB = 0x0001; pub const PEEK = 0x0002; pub const DONTROUTE = 0x0004; @@ -5825,7 +5816,7 @@ pub const SOCK = switch (native_os) { pub const CLOEXEC = 0x10000000; pub const NONBLOCK = 0x20000000; }, - .solaris, .illumos => struct { + .illumos => struct { /// Datagram. pub const DGRAM = 1; /// STREAM. @@ -6155,7 +6146,7 @@ pub const IPPROTO = switch (native_os) { /// Reserved pub const RESERVED_254 = 254; }, - .solaris, .illumos => struct { + .illumos => struct { /// dummy for IP pub const IP = 0; /// Hop by hop header for IPv6 @@ -6514,7 +6505,7 @@ pub const IP = switch (native_os) { .dragonfly => dragonfly.IP, .netbsd => netbsd.IP, .openbsd => openbsd.IP, - .solaris, .illumos => solaris.IP, + .illumos => illumos.IP, .haiku => haiku.IP, .serenity => serenity.IP, else => void, @@ -6525,7 +6516,7 @@ pub const IPV6 = switch (native_os) { .dragonfly => dragonfly.IPV6, .netbsd => netbsd.IPV6, .openbsd => openbsd.IPV6, - .solaris, .illumos => solaris.IPV6, + .illumos => illumos.IPV6, .haiku => haiku.IPV6, .serenity => serenity.IPV6, else => void, @@ -6536,7 +6527,7 @@ pub const IPTOS = switch (native_os) { .dragonfly => dragonfly.IPTOS, .netbsd => netbsd.IPTOS, .openbsd => openbsd.IPTOS, - .solaris, .illumos => solaris.IPTOS, + .illumos => illumos.IPTOS, .haiku => haiku.IPTOS, .serenity => serenity.IPTOS, else => void, @@ -6548,7 +6539,7 @@ pub const SOL = switch (native_os) { .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct { pub const SOCKET = 0xffff; }, - .solaris, .illumos => struct { + .illumos => struct { pub const SOCKET = 0xffff; pub const ROUTE = 0xfffe; pub const PACKET = 0xfffd; @@ -6632,7 +6623,7 @@ pub const SO = switch (native_os) { pub const MAX_PACING_RATE = 0x1018; pub const DOMAIN = 0x1019; }, - .solaris, .illumos => struct { + .illumos => struct { pub const DEBUG = 0x0001; pub const ACCEPTCONN = 0x0002; pub const REUSEADDR = 0x0004; @@ -6803,7 +6794,7 @@ pub const SOMAXCONN = switch (native_os) { .linux => linux.SOMAXCONN, .windows => ws2_32.SOMAXCONN, // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L128 - .solaris, .illumos, .serenity => 128, + .illumos, .serenity => 128, // https://github.com/freebsd/freebsd-src/blob/9ab31f821ad1c6bad474510447387c50bef2c24c/sys/sys/socket.h#L434 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/fd3d1949d526ffa646e57037770acd6f2f3bb617/sys/sys/socket.h#L393 // https://github.com/NetBSD/src/blob/a673fb3f8487e974c669216064f7588207229fea/sys/sys/socket.h#L472 @@ -6814,9 +6805,8 @@ pub const SOMAXCONN = switch (native_os) { }; pub const SCM = switch (native_os) { .linux, .emscripten => linux.SCM, - // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L172 // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L196 - .solaris, .illumos => struct { + .illumos => struct { pub const RIGHTS = 0x1010; pub const UCRED = 0x1012; pub const TIMESTAMP = SO.TIMESTAMP; @@ -6874,7 +6864,7 @@ pub const IFNAMESIZE = switch (native_os) { .windows => 30, // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L50 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 16, - .solaris, .illumos => 32, + .illumos => 32, else => void, }; @@ -6910,7 +6900,7 @@ pub const time_t = switch (native_os) { }; pub const suseconds_t = switch (native_os) { // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L49 - .solaris, .illumos, .serenity => i64, + .illumos, .serenity => i64, .freebsd, .dragonfly => c_long, .netbsd => c_int, .haiku => i32, @@ -6929,7 +6919,7 @@ pub const timeval = switch (native_os) { usec: i32, }, // https://github.com/SerenityOS/serenity/blob/6b6eca0631c893c5f8cfb8274cdfe18e2d0637c0/Kernel/API/POSIX/sys/time.h#L15-L18 - .dragonfly, .netbsd, .freebsd, .solaris, .illumos, .serenity => extern struct { + .dragonfly, .netbsd, .freebsd, .illumos, .serenity => extern struct { /// seconds sec: time_t, /// microseconds @@ -6963,7 +6953,7 @@ pub const user_desc = switch (native_os) { pub const utsname = switch (native_os) { .linux => linux.utsname, .emscripten => emscripten.utsname, - .solaris, .illumos => extern struct { + .illumos => extern struct { sysname: [256:0]u8, nodename: [256:0]u8, release: [256:0]u8, @@ -7003,7 +6993,7 @@ pub const _errno = switch (native_os) { .wasi, .dragonfly => private.errnoFromThreadLocal, .windows => private._errno, .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error, - .solaris, .illumos => private.___errno, + .illumos => private.___errno, .openbsd, .netbsd => private.__errno, .haiku => haiku._errnop, // https://github.com/SerenityOS/serenity/blob/a353ceecf13b6f156a078e32f1ddf1d21366934c/Userland/Libraries/LibC/errno.h#L33 @@ -7049,7 +7039,7 @@ pub const RTLD = switch (native_os) { NOLOAD: bool = false, _: u18 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { LAZY: bool = false, NOW: bool = false, NOLOAD: bool = false, @@ -7128,7 +7118,7 @@ pub const dirent = switch (native_os) { /// Name of entry. name: [255:0]u8, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { /// Inode number of entry. ino: ino_t, /// Offset of this entry on disk. @@ -7177,7 +7167,7 @@ pub const dirent = switch (native_os) { else => void, }; pub const MAXNAMLEN = switch (native_os) { - .netbsd, .solaris, .illumos => 511, + .netbsd, .illumos => 511, // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L37 .haiku, .serenity => NAME_MAX, .openbsd => 255, @@ -7228,7 +7218,7 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) { ADDRCONFIG: bool = false, _: u21 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { V4MAPPED: bool = false, ALL: bool = false, ADDRCONFIG: bool = false, @@ -7286,7 +7276,7 @@ pub const NI = switch (native_os) { NUMERICSCOPE: bool = false, _: u23 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { NOFQDN: bool = false, NUMERICHOST: bool = false, NAMEREQD: bool = false, @@ -7396,7 +7386,7 @@ pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) { OVERFLOW = 14, _, }, - .solaris, .illumos => enum(c_int) { + .illumos => enum(c_int) { /// address family for hostname not supported ADDRFAMILY = 1, /// name could not be resolved at this time @@ -7736,7 +7726,7 @@ pub const Stat = switch (native_os) { } }, .freebsd => freebsd.Stat, - .solaris, .illumos => extern struct { + .illumos => extern struct { dev: dev_t, ino: ino_t, mode: mode_t, @@ -7970,7 +7960,7 @@ pub const pthread_mutex_t = switch (native_os) { owner: i32 = -1, owner_count: i32 = 0, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { flag1: u16 = 0, flag2: u8 = 0, ceiling: u8 = 0, @@ -8025,7 +8015,7 @@ pub const pthread_cond_t = switch (native_os) { waiter_count: i32 = 0, lock: i32 = 0, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { flag: [4]u8 = [_]u8{0} ** 4, type: u16 = 0, magic: u16 = 0x4356, @@ -8084,7 +8074,7 @@ pub const pthread_rwlock_t = switch (native_os) { owner: ?pthread_t = null, private: ?*anyopaque = null, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { readers: i32 = 0, type: u16 = 0, magic: u16 = 0x5257, @@ -8118,7 +8108,7 @@ pub const pthread_attr_t = switch (native_os) { .freebsd, .openbsd, .serenity => extern struct { inner: ?*anyopaque = null, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { mutexattr: ?*anyopaque = null, }, .netbsd => extern struct { @@ -8140,7 +8130,7 @@ pub const pthread_key_t = switch (native_os) { .linux, .emscripten => c_uint, .macos, .ios, .tvos, .watchos, .visionos => c_ulong, // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L65 - .openbsd, .solaris, .illumos, .serenity => c_int, + .openbsd, .illumos, .serenity => c_int, else => void, }; @@ -8180,7 +8170,7 @@ pub const sem_t = switch (native_os) { }, _padding: u32, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { count: u32 = 0, type: u16 = 0, magic: u16 = 0x534d, @@ -8271,12 +8261,12 @@ pub const Kevent = switch (native_os) { }; pub const port_t = switch (native_os) { - .solaris, .illumos => c_int, + .illumos => c_int, else => void, }; pub const port_event = switch (native_os) { - .solaris, .illumos => extern struct { + .illumos => extern struct { events: u32, /// Event source. source: u16, @@ -8364,7 +8354,7 @@ pub const AT = switch (native_os) { pub const REMOVEDIR = 0x04; pub const EACCESS = 0x08; }, - .solaris, .illumos => struct { + .illumos => struct { /// Magic value that specify the use of the current working directory /// to determine the target of relative file paths in the openat() and /// similar syscalls. @@ -8461,7 +8451,7 @@ pub const O = switch (native_os) { // ignored in C code. Thus no mapping in Zig. _: u3 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { ACCMODE: std.posix.ACCMODE = .RDONLY, NDELAY: bool = false, APPEND: bool = false, @@ -8672,7 +8662,7 @@ pub const MAP = switch (native_os) { FIXED_NOREPLACE: bool = false, _: u11 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { TYPE: enum(u4) { SHARED = 0x01, PRIVATE = 0x02, @@ -8869,7 +8859,7 @@ pub const V = switch (native_os) { STOP, SUSP, }, - .solaris, .illumos => enum { + .illumos => enum { INTR, QUIT, ERASE, @@ -8936,7 +8926,7 @@ pub const NCCS = switch (native_os) { .linux => linux.NCCS, .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20, .haiku => 11, - .solaris, .illumos => 19, + .illumos => 19, // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L15 .emscripten, .wasi, .serenity => 32, else => void, @@ -8973,7 +8963,7 @@ pub const termios = switch (native_os) { ospeed: speed_t, cc: [NCCS]cc_t, }, - .solaris, .illumos => extern struct { + .illumos => extern struct { iflag: tc_iflag_t, oflag: tc_oflag_t, cflag: tc_cflag_t, @@ -9063,7 +9053,7 @@ pub const tc_iflag_t = switch (native_os) { IXOFF: bool = false, _: u19 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { IGNBRK: bool = false, BRKINT: bool = false, IGNPAR: bool = false, @@ -9156,7 +9146,7 @@ pub const tc_oflag_t = switch (native_os) { ONLRET: bool = false, _: u25 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { OPOST: bool = false, OLCUC: bool = false, ONLCR: bool = false, @@ -9303,7 +9293,7 @@ pub const tc_cflag_t = switch (native_os) { RTSFLOW: bool = false, _: u17 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { _0: u4 = 0, CSIZE: CSIZE = .CS5, CSTOPB: bool = false, @@ -9441,7 +9431,7 @@ pub const tc_lflag_t = switch (native_os) { PENDIN: bool = false, _: u17 = 0, }, - .solaris, .illumos => packed struct(u32) { + .illumos => packed struct(u32) { ISIG: bool = false, ICANON: bool = false, XCASE: bool = false, @@ -9609,7 +9599,7 @@ pub const speed_t = switch (native_os) { B230400 = 0x12, B31250 = 0x13, }, - .solaris, .illumos => enum(c_uint) { + .illumos => enum(c_uint) { B0 = 0, B50 = 1, B75 = 2, @@ -9696,7 +9686,7 @@ pub const NSIG = switch (native_os) { .haiku => 65, .netbsd, .freebsd => 32, .macos => darwin.NSIG, - .solaris, .illumos => 75, + .illumos => 75, // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h#L42 .openbsd, .serenity => 33, else => {}, @@ -9709,7 +9699,7 @@ pub const MINSIGSTKSZ = switch (native_os) { .arm, .aarch64 => 4096, else => @compileError("unsupported arch"), }, - .solaris, .illumos => 2048, + .illumos => 2048, .haiku, .netbsd => 8192, .openbsd => 1 << openbsd.MAX_PAGE_SHIFT, // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L58 @@ -9719,7 +9709,7 @@ pub const MINSIGSTKSZ = switch (native_os) { pub const SIGSTKSZ = switch (native_os) { .macos, .ios, .tvos, .watchos, .visionos => 131072, .netbsd, .freebsd => MINSIGSTKSZ + 32768, - .solaris, .illumos => 8192, + .illumos => 8192, .haiku => 16384, .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4, // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L59 @@ -9733,7 +9723,7 @@ pub const SS = switch (native_os) { pub const DISABLE = 4; }, // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L54-L55 - .haiku, .solaris, .illumos, .serenity => struct { + .haiku, .illumos, .serenity => struct { pub const ONSTACK = 0x1; pub const DISABLE = 0x2; }, @@ -10314,7 +10304,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_ pub const arc4random_buf = switch (native_os) { .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {}, - .dragonfly, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf, + .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf, else => {}, }; pub const getentropy = switch (native_os) { @@ -10383,7 +10373,7 @@ pub const sigaltstack = switch (native_os) { pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int; pub const pipe2 = switch (native_os) { - .dragonfly, .emscripten, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .linux, .serenity => private.pipe2, + .dragonfly, .emscripten, .netbsd, .freebsd, .illumos, .openbsd, .linux, .serenity => private.pipe2, else => {}, }; pub const copy_file_range = switch (native_os) { @@ -10443,12 +10433,12 @@ pub const munlock = switch (native_os) { }; pub const mlockall = switch (native_os) { - .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.mlockall, + .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.mlockall, else => {}, }; pub const munlockall = switch (native_os) { - .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.munlockall, + .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.munlockall, else => {}, }; @@ -10491,7 +10481,7 @@ pub fn sigrtmin() u8 { return switch (native_os) { .freebsd => 65, .netbsd => 33, - .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))), + .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))), else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))), }; } @@ -10501,7 +10491,7 @@ pub fn sigrtmax() u8 { return switch (native_os) { .freebsd => 126, .netbsd => 63, - .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))), + .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))), else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))), }; } @@ -10556,11 +10546,11 @@ pub const malloc_usable_size = switch (native_os) { else => {}, }; pub const posix_memalign = switch (native_os) { - .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => private.posix_memalign, + .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => private.posix_memalign, else => {}, }; pub const sysconf = switch (native_os) { - .solaris => solaris.sysconf, + .illumos => illumos.sysconf, else => private.sysconf, }; @@ -10629,7 +10619,6 @@ pub const fork = switch (native_os) { .macos, .netbsd, .openbsd, - .solaris, .illumos, .tvos, .watchos, @@ -10777,7 +10766,7 @@ pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_ pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int; pub const pthread_setname_np = switch (native_os) { .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np, - .solaris, .illumos => solaris.pthread_setname_np, + .illumos => illumos.pthread_setname_np, .netbsd => netbsd.pthread_setname_np, else => private.pthread_setname_np, }; @@ -10987,33 +10976,33 @@ pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usi // OS-specific bits. These are protected from being used on the wrong OS by // comptime assertions inside each OS-specific file. -pub const AF_SUN = solaris.AF_SUN; -pub const AT_SUN = solaris.AT_SUN; -pub const FILE_EVENT = solaris.FILE_EVENT; -pub const GETCONTEXT = solaris.GETCONTEXT; -pub const GETUSTACK = solaris.GETUSTACK; -pub const PORT_ALERT = solaris.PORT_ALERT; -pub const PORT_SOURCE = solaris.PORT_SOURCE; -pub const POSIX_FADV = solaris.POSIX_FADV; -pub const SETCONTEXT = solaris.SETCONTEXT; -pub const SETUSTACK = solaris.GETUSTACK; -pub const SFD = solaris.SFD; -pub const ctid_t = solaris.ctid_t; -pub const file_obj = solaris.file_obj; -pub const id_t = solaris.id_t; -pub const lif_ifinfo_req = solaris.lif_ifinfo_req; -pub const lif_nd_req = solaris.lif_nd_req; -pub const lifreq = solaris.lifreq; -pub const major_t = solaris.major_t; -pub const minor_t = solaris.minor_t; -pub const poolid_t = solaris.poolid_t; -pub const port_notify = solaris.port_notify; -pub const priority = solaris.priority; -pub const procfs = solaris.procfs; -pub const projid_t = solaris.projid_t; -pub const signalfd_siginfo = solaris.signalfd_siginfo; -pub const taskid_t = solaris.taskid_t; -pub const zoneid_t = solaris.zoneid_t; +pub const AF_SUN = illumos.AF_SUN; +pub const AT_SUN = illumos.AT_SUN; +pub const FILE_EVENT = illumos.FILE_EVENT; +pub const GETCONTEXT = illumos.GETCONTEXT; +pub const GETUSTACK = illumos.GETUSTACK; +pub const PORT_ALERT = illumos.PORT_ALERT; +pub const PORT_SOURCE = illumos.PORT_SOURCE; +pub const POSIX_FADV = illumos.POSIX_FADV; +pub const SETCONTEXT = illumos.SETCONTEXT; +pub const SETUSTACK = illumos.GETUSTACK; +pub const SFD = illumos.SFD; +pub const ctid_t = illumos.ctid_t; +pub const file_obj = illumos.file_obj; +pub const id_t = illumos.id_t; +pub const lif_ifinfo_req = illumos.lif_ifinfo_req; +pub const lif_nd_req = illumos.lif_nd_req; +pub const lifreq = illumos.lifreq; +pub const major_t = illumos.major_t; +pub const minor_t = illumos.minor_t; +pub const poolid_t = illumos.poolid_t; +pub const port_notify = illumos.port_notify; +pub const priority = illumos.priority; +pub const procfs = illumos.procfs; +pub const projid_t = illumos.projid_t; +pub const signalfd_siginfo = illumos.signalfd_siginfo; +pub const taskid_t = illumos.taskid_t; +pub const zoneid_t = illumos.zoneid_t; pub const DirEnt = haiku.DirEnt; pub const _get_next_area_info = haiku._get_next_area_info; @@ -11361,7 +11350,7 @@ const private = struct { extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize; extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) { .freebsd => isize, - .solaris, .illumos => usize, + .illumos => usize, else => c_int, }; extern "c" fn getrusage(who: c_int, usage: *rusage) c_int; diff --git a/lib/std/c/illumos.zig b/lib/std/c/illumos.zig new file mode 100644 index 0000000000000000000000000000000000000000..694b7de5ece063c64e657a990edd105d09883304 --- /dev/null +++ b/lib/std/c/illumos.zig @@ -0,0 +1,457 @@ +const builtin = @import("builtin"); +const std = @import("../std.zig"); +const assert = std.debug.assert; +const SO = std.c.SO; +const fd_t = std.c.fd_t; +const gid_t = std.c.gid_t; +const ino_t = std.c.ino_t; +const mode_t = std.c.mode_t; +const off_t = std.c.off_t; +const pid_t = std.c.pid_t; +const pthread_t = std.c.pthread_t; +const sockaddr = std.c.sockaddr; +const socklen_t = std.c.socklen_t; +const timespec = std.c.timespec; +const uid_t = std.c.uid_t; +const IFNAMESIZE = std.c.IFNAMESIZE; + +comptime { + assert(builtin.os.tag == .illumos); // Prevent access of std.c symbols on wrong OS. +} + +pub extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int; +pub extern "c" fn sysconf(sc: c_int) i64; + +pub const major_t = u32; +pub const minor_t = u32; +pub const id_t = i32; +pub const taskid_t = id_t; +pub const projid_t = id_t; +pub const poolid_t = id_t; +pub const zoneid_t = id_t; +pub const ctid_t = id_t; + +pub const GETCONTEXT = 0; +pub const SETCONTEXT = 1; +pub const GETUSTACK = 2; +pub const SETUSTACK = 3; + +pub const POSIX_FADV = struct { + pub const NORMAL = 0; + pub const RANDOM = 1; + pub const SEQUENTIAL = 2; + pub const WILLNEED = 3; + pub const DONTNEED = 4; + pub const NOREUSE = 5; +}; + +pub const priority = enum(c_int) { + PROCESS = 0, + PGRP = 1, + USER = 2, + GROUP = 3, + SESSION = 4, + LWP = 5, + TASK = 6, + PROJECT = 7, + ZONE = 8, + CONTRACT = 9, +}; + +/// Extensions to the ELF auxiliary vector. +pub const AT_SUN = struct { + /// effective user id + pub const UID = 2000; + /// real user id + pub const RUID = 2001; + /// effective group id + pub const GID = 2002; + /// real group id + pub const RGID = 2003; + /// dynamic linker's ELF header + pub const LDELF = 2004; + /// dynamic linker's section headers + pub const LDSHDR = 2005; + /// name of dynamic linker + pub const LDNAME = 2006; + /// large pagesize + pub const LPAGESZ = 2007; + /// platform name + pub const PLATFORM = 2008; + /// hints about hardware capabilities. + pub const HWCAP = 2009; + pub const HWCAP2 = 2023; + /// flush icache? + pub const IFLUSH = 2010; + /// cpu name + pub const CPU = 2011; + /// exec() path name in the auxv, null terminated. + pub const EXECNAME = 2014; + /// mmu module name + pub const MMU = 2015; + /// dynamic linkers data segment + pub const LDDATA = 2016; + /// AF_SUN_ flags passed from the kernel + pub const AUXFLAGS = 2017; + /// name of the emulation binary for the linker + pub const EMULATOR = 2018; + /// name of the brand library for the linker + pub const BRANDNAME = 2019; + /// vectors for brand modules. + pub const BRAND_AUX1 = 2020; + pub const BRAND_AUX2 = 2021; + pub const BRAND_AUX3 = 2022; + pub const BRAND_AUX4 = 2025; + pub const BRAND_NROOT = 2024; + /// vector for comm page. + pub const COMMPAGE = 2026; + /// information about the x86 FPU. + pub const FPTYPE = 2027; + pub const FPSIZE = 2028; +}; + +/// ELF auxiliary vector flags. +pub const AF_SUN = struct { + /// tell ld.so.1 to run "secure" and ignore the environment. + pub const SETUGID = 0x00000001; + /// hardware capabilities can be verified against AT_SUN_HWCAP + pub const HWCAPVERIFY = 0x00000002; + pub const NOPLM = 0x00000004; +}; + +pub const procfs = struct { + pub const misc_header = extern struct { + size: u32, + type: enum(u32) { + Pathname, + Socketname, + Peersockname, + SockoptsBoolOpts, + SockoptLinger, + SockoptSndbuf, + SockoptRcvbuf, + SockoptIpNexthop, + SockoptIpv6Nexthop, + SockoptType, + SockoptTcpCongestion, + SockfiltersPriv = 14, + }, + }; + + pub const fdinfo = extern struct { + fd: fd_t, + mode: mode_t, + ino: ino_t, + size: off_t, + offset: off_t, + uid: uid_t, + gid: gid_t, + dev_major: major_t, + dev_minor: minor_t, + special_major: major_t, + special_minor: minor_t, + fileflags: i32, + fdflags: i32, + locktype: i16, + lockpid: pid_t, + locksysid: i32, + peerpid: pid_t, + __filler: [25]c_int, + peername: [15:0]u8, + misc: [1]u8, + }; +}; + +pub const SFD = struct { + pub const CLOEXEC = 0o2000000; + pub const NONBLOCK = 0o4000; +}; + +pub const signalfd_siginfo = extern struct { + signo: u32, + errno: i32, + code: i32, + pid: u32, + uid: uid_t, + fd: i32, + tid: u32, // unused + band: u32, + overrun: u32, // unused + trapno: u32, + status: i32, + int: i32, // unused + ptr: u64, // unused + utime: u64, + stime: u64, + addr: u64, + __pad: [48]u8, +}; + +pub const PORT_SOURCE = struct { + pub const AIO = 1; + pub const TIMER = 2; + pub const USER = 3; + pub const FD = 4; + pub const ALERT = 5; + pub const MQ = 6; + pub const FILE = 7; +}; + +pub const PORT_ALERT = struct { + pub const SET = 0x01; + pub const UPDATE = 0x02; +}; + +/// User watchable file events. +pub const FILE_EVENT = struct { + pub const ACCESS = 0x00000001; + pub const MODIFIED = 0x00000002; + pub const ATTRIB = 0x00000004; + pub const DELETE = 0x00000010; + pub const RENAME_TO = 0x00000020; + pub const RENAME_FROM = 0x00000040; + pub const TRUNC = 0x00100000; + pub const NOFOLLOW = 0x10000000; + /// The filesystem holding the watched file was unmounted. + pub const UNMOUNTED = 0x20000000; + /// Some other file/filesystem got mounted over the watched file/directory. + pub const MOUNTEDOVER = 0x40000000; + + pub fn isException(event: u32) bool { + return event & (UNMOUNTED | DELETE | RENAME_TO | RENAME_FROM | MOUNTEDOVER) > 0; + } +}; + +pub const port_notify = extern struct { + /// Bind request(s) to port. + port: u32, + /// User defined variable. + user: ?*void, +}; + +pub const file_obj = extern struct { + /// Access time. + atim: timespec, + /// Modification time + mtim: timespec, + /// Change time + ctim: timespec, + __pad: [3]usize, + name: [*:0]u8, +}; + +// struct ifreq is marked obsolete, with struct lifreq preferred for interface requests. +// Here we alias lifreq to ifreq to avoid chainging existing code in os and x.os.IPv6. +pub const SIOCGLIFINDEX = IOWR('i', 133, lifreq); + +pub const lif_nd_req = extern struct { + addr: sockaddr.storage, + state_create: u8, + state_same_lla: u8, + state_diff_lla: u8, + hdw_len: i32, + flags: i32, + __pad: i32, + hdw_addr: [64]u8, +}; + +pub const lif_ifinfo_req = extern struct { + maxhops: u8, + reachtime: u32, + reachretrans: u32, + maxmtu: u32, +}; + +/// IP interface request. See if_tcp(7p) for more info. +pub const lifreq = extern struct { + // Not actually in a union, but the stdlib expects one for ifreq + ifrn: extern union { + /// Interface name, e.g. "lo0", "en0". + name: [IFNAMESIZE]u8, + }, + ru1: extern union { + /// For subnet/token etc. + addrlen: i32, + /// Driver's PPA (physical point of attachment). + ppa: u32, + }, + /// One of the IFT types, e.g. IFT_ETHER. + type: u32, + ifru: extern union { + /// Address. + addr: sockaddr.storage, + /// Other end of a peer-to-peer link. + dstaddr: sockaddr.storage, + /// Broadcast address. + broadaddr: sockaddr.storage, + /// Address token. + token: sockaddr.storage, + /// Subnet prefix. + subnet: sockaddr.storage, + /// Interface index. + ivalue: i32, + /// Flags for SIOC?LIFFLAGS. + flags: u64, + /// Hop count metric + metric: i32, + /// Maximum transmission unit + mtu: u32, + // Technically [2]i32 + muxid: packed struct { ip: i32, arp: i32 }, + /// Neighbor reachability determination entries + nd_req: lif_nd_req, + /// Link info + ifinfo_req: lif_ifinfo_req, + /// Name of the multipath interface group + groupname: [IFNAMESIZE]u8, + binding: [IFNAMESIZE]u8, + /// Zone id associated with this interface. + zoneid: zoneid_t, + /// Duplicate address detection state. Either in progress or completed. + dadstate: u32, + }, +}; + +const IoCtlCommand = enum(u32) { + none = 0x20000000, // no parameters + write = 0x40000000, // copy out parameters + read = 0x80000000, // copy in parameters + read_write = 0xc0000000, +}; + +fn ioImpl(cmd: IoCtlCommand, io_type: u8, nr: u8, comptime IOT: type) i32 { + const size = @as(u32, @intCast(@as(u8, @truncate(@sizeOf(IOT))))) << 16; + const t = @as(u32, @intCast(io_type)) << 8; + return @as(i32, @bitCast(@intFromEnum(cmd) | size | t | nr)); +} + +pub fn IO(io_type: u8, nr: u8) i32 { + return ioImpl(.none, io_type, nr, void); +} + +pub fn IOR(io_type: u8, nr: u8, comptime IOT: type) i32 { + return ioImpl(.write, io_type, nr, IOT); +} + +pub fn IOW(io_type: u8, nr: u8, comptime IOT: type) i32 { + return ioImpl(.read, io_type, nr, IOT); +} + +pub fn IOWR(io_type: u8, nr: u8, comptime IOT: type) i32 { + return ioImpl(.read_write, io_type, nr, IOT); +} + +// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1141 +// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those) +pub const IP = struct { + pub const OPTIONS = 1; + pub const HDRINCL = 2; + pub const TOS = 3; + pub const TTL = 4; + pub const RECVOPTS = 0x5; + pub const RECVRETOPTS = 0x6; + pub const RECVDSTADDR = 0x7; + pub const RETOPTS = 0x8; + pub const RECVIF = 0x9; + pub const RECVSLLA = 0xa; + pub const RECVTTL = 0xb; + pub const RECVTOS = 0xc; + pub const MULTICAST_IF = 0x10; + pub const MULTICAST_TTL = 0x11; + pub const MULTICAST_LOOP = 0x12; + pub const ADD_MEMBERSHIP = 0x13; + pub const DROP_MEMBERSHIP = 0x14; + pub const BLOCK_SOURCE = 0x15; + pub const UNBLOCK_SOURCE = 0x16; + pub const ADD_SOURCE_MEMBERSHIP = 0x17; + pub const DROP_SOURCE_MEMBERSHIP = 0x18; + pub const NEXTHOP = 0x19; + pub const PKTINFO = 0x1a; + pub const RECVPKTINFO = 0x1a; + pub const DONTFRAG = 0x1b; + pub const MINTTL = 0x1c; + pub const SEC_OPT = 0x22; + pub const BOUND_IF = 0x41; + pub const UNSPEC_SRC = 0x42; + pub const BROADCAST_TTL = 0x43; + pub const DHCPINIT_IF = 0x45; + pub const REUSEADDR = 0x104; + pub const DONTROUTE = 0x105; + pub const BROADCAST = 0x106; + // Same namespace, but these are arguments rather than option names + pub const DEFAULT_MULTICAST_TTL = 1; + pub const DEFAULT_MULTICAST_LOOP = 1; +}; + +// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1192 +// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those) +pub const IPV6 = struct { + pub const UNICAST_HOPS = 0x5; + pub const MULTICAST_IF = 0x6; + pub const MULTICAST_HOPS = 0x7; + pub const MULTICAST_LOOP = 0x8; + pub const JOIN_GROUP = 0x9; + pub const LEAVE_GROUP = 0xa; + pub const ADD_MEMBERSHIP = 0x9; + pub const DROP_MEMBERSHIP = 0xa; + pub const PKTINFO = 0xb; + pub const HOPLIMIT = 0xc; + pub const NEXTHOP = 0xd; + pub const HOPOPTS = 0xe; + pub const DSTOPTS = 0xf; + pub const RTHDR = 0x10; + pub const RTHDRDSTOPTS = 0x11; + pub const RECVPKTINFO = 0x12; + pub const RECVHOPLIMIT = 0x13; + pub const RECVHOPOPTS = 0x14; + pub const OLD_RECVDSTOPTS = 0x15; + pub const RECVRTHDR = 0x16; + pub const RECVRTHDRDSTOPTS = 0x17; + pub const CHECKSUM = 0x18; + pub const RECVTCLASS = 0x19; + pub const USE_MIN_MTU = 0x20; + pub const DONTFRAG = 0x21; + pub const SEC_OPT = 0x22; + pub const SRC_PREFERENCES = 0x23; + pub const RECVPATHMTU = 0x24; + pub const PATHMTU = 0x25; + pub const TCLASS = 0x26; + pub const V6ONLY = 0x27; + pub const RECVDSTOPTS = 0x28; + pub const MINHOPCOUNT = 0x2f; + pub const BOUND_IF = 0x41; + pub const UNSPEC_SRC = 0x42; + // Same namespace, but these are arguments rather than option names + pub const RTHDR_TYPE_0 = 0; + pub const PREFER_SRC_HOME = 0x01; + pub const PREFER_SRC_COA = 0x02; + pub const PREFER_SRC_PUBLIC = 0x04; + pub const PREFER_SRC_TMP = 0x08; + pub const PREFER_SRC_NONCGA = 0x10; + pub const PREFER_SRC_CGA = 0x20; + pub const PREFER_SRC_MIPMASK = PREFER_SRC_HOME | PREFER_SRC_COA; + pub const PREFER_SRC_MIPDEFAULT = PREFER_SRC_HOME; + pub const PREFER_SRC_TMPMASK = PREFER_SRC_PUBLIC | PREFER_SRC_TMP; + pub const PREFER_SRC_TMPDEFAULT = PREFER_SRC_PUBLIC; + pub const PREFER_SRC_CGAMASK = PREFER_SRC_NONCGA | PREFER_SRC_CGA; + pub const PREFER_SRC_CGADEFAULT = PREFER_SRC_NONCGA; + pub const PREFER_SRC_MASK = PREFER_SRC_MIPMASK | PREFER_SRC_TMPMASK | PREFER_SRC_CGAMASK; + pub const PREFER_SRC_DEFAULT = PREFER_SRC_MIPDEFAULT | PREFER_SRC_TMPDEFAULT | PREFER_SRC_CGADEFAULT; +}; + +// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/ip.h#L64 +pub const IPTOS = struct { + pub const LOWDELAY = 0x10; + pub const THROUGHPUT = 0x08; + pub const RELIABILITY = 0x04; + pub const ECT = 0x02; + pub const CE = 0x01; + pub const PREC_NETCONTROL = 0xe0; + pub const PREC_INTERNETCONTROL = 0xc0; + pub const PREC_CRITIC_ECP = 0xa0; + pub const PREC_FLASHOVERRIDE = 0x80; + pub const PREC_FLASH = 0x60; + pub const PREC_IMMEDIATE = 0x40; + pub const PREC_PRIORITY = 0x20; + pub const PREC_ROUTINE = 0x00; +}; diff --git a/lib/std/c/solaris.zig b/lib/std/c/solaris.zig deleted file mode 100644 index e69c77dac7f6db665dc4ac50c4a877c69681f0b9..0000000000000000000000000000000000000000 --- a/lib/std/c/solaris.zig +++ /dev/null @@ -1,457 +0,0 @@ -const builtin = @import("builtin"); -const std = @import("../std.zig"); -const assert = std.debug.assert; -const SO = std.c.SO; -const fd_t = std.c.fd_t; -const gid_t = std.c.gid_t; -const ino_t = std.c.ino_t; -const mode_t = std.c.mode_t; -const off_t = std.c.off_t; -const pid_t = std.c.pid_t; -const pthread_t = std.c.pthread_t; -const sockaddr = std.c.sockaddr; -const socklen_t = std.c.socklen_t; -const timespec = std.c.timespec; -const uid_t = std.c.uid_t; -const IFNAMESIZE = std.c.IFNAMESIZE; - -comptime { - assert(builtin.os.tag == .solaris or builtin.os.tag == .illumos); // Prevent access of std.c symbols on wrong OS. -} - -pub extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int; -pub extern "c" fn sysconf(sc: c_int) i64; - -pub const major_t = u32; -pub const minor_t = u32; -pub const id_t = i32; -pub const taskid_t = id_t; -pub const projid_t = id_t; -pub const poolid_t = id_t; -pub const zoneid_t = id_t; -pub const ctid_t = id_t; - -pub const GETCONTEXT = 0; -pub const SETCONTEXT = 1; -pub const GETUSTACK = 2; -pub const SETUSTACK = 3; - -pub const POSIX_FADV = struct { - pub const NORMAL = 0; - pub const RANDOM = 1; - pub const SEQUENTIAL = 2; - pub const WILLNEED = 3; - pub const DONTNEED = 4; - pub const NOREUSE = 5; -}; - -pub const priority = enum(c_int) { - PROCESS = 0, - PGRP = 1, - USER = 2, - GROUP = 3, - SESSION = 4, - LWP = 5, - TASK = 6, - PROJECT = 7, - ZONE = 8, - CONTRACT = 9, -}; - -/// Extensions to the ELF auxiliary vector. -pub const AT_SUN = struct { - /// effective user id - pub const UID = 2000; - /// real user id - pub const RUID = 2001; - /// effective group id - pub const GID = 2002; - /// real group id - pub const RGID = 2003; - /// dynamic linker's ELF header - pub const LDELF = 2004; - /// dynamic linker's section headers - pub const LDSHDR = 2005; - /// name of dynamic linker - pub const LDNAME = 2006; - /// large pagesize - pub const LPAGESZ = 2007; - /// platform name - pub const PLATFORM = 2008; - /// hints about hardware capabilities. - pub const HWCAP = 2009; - pub const HWCAP2 = 2023; - /// flush icache? - pub const IFLUSH = 2010; - /// cpu name - pub const CPU = 2011; - /// exec() path name in the auxv, null terminated. - pub const EXECNAME = 2014; - /// mmu module name - pub const MMU = 2015; - /// dynamic linkers data segment - pub const LDDATA = 2016; - /// AF_SUN_ flags passed from the kernel - pub const AUXFLAGS = 2017; - /// name of the emulation binary for the linker - pub const EMULATOR = 2018; - /// name of the brand library for the linker - pub const BRANDNAME = 2019; - /// vectors for brand modules. - pub const BRAND_AUX1 = 2020; - pub const BRAND_AUX2 = 2021; - pub const BRAND_AUX3 = 2022; - pub const BRAND_AUX4 = 2025; - pub const BRAND_NROOT = 2024; - /// vector for comm page. - pub const COMMPAGE = 2026; - /// information about the x86 FPU. - pub const FPTYPE = 2027; - pub const FPSIZE = 2028; -}; - -/// ELF auxiliary vector flags. -pub const AF_SUN = struct { - /// tell ld.so.1 to run "secure" and ignore the environment. - pub const SETUGID = 0x00000001; - /// hardware capabilities can be verified against AT_SUN_HWCAP - pub const HWCAPVERIFY = 0x00000002; - pub const NOPLM = 0x00000004; -}; - -pub const procfs = struct { - pub const misc_header = extern struct { - size: u32, - type: enum(u32) { - Pathname, - Socketname, - Peersockname, - SockoptsBoolOpts, - SockoptLinger, - SockoptSndbuf, - SockoptRcvbuf, - SockoptIpNexthop, - SockoptIpv6Nexthop, - SockoptType, - SockoptTcpCongestion, - SockfiltersPriv = 14, - }, - }; - - pub const fdinfo = extern struct { - fd: fd_t, - mode: mode_t, - ino: ino_t, - size: off_t, - offset: off_t, - uid: uid_t, - gid: gid_t, - dev_major: major_t, - dev_minor: minor_t, - special_major: major_t, - special_minor: minor_t, - fileflags: i32, - fdflags: i32, - locktype: i16, - lockpid: pid_t, - locksysid: i32, - peerpid: pid_t, - __filler: [25]c_int, - peername: [15:0]u8, - misc: [1]u8, - }; -}; - -pub const SFD = struct { - pub const CLOEXEC = 0o2000000; - pub const NONBLOCK = 0o4000; -}; - -pub const signalfd_siginfo = extern struct { - signo: u32, - errno: i32, - code: i32, - pid: u32, - uid: uid_t, - fd: i32, - tid: u32, // unused - band: u32, - overrun: u32, // unused - trapno: u32, - status: i32, - int: i32, // unused - ptr: u64, // unused - utime: u64, - stime: u64, - addr: u64, - __pad: [48]u8, -}; - -pub const PORT_SOURCE = struct { - pub const AIO = 1; - pub const TIMER = 2; - pub const USER = 3; - pub const FD = 4; - pub const ALERT = 5; - pub const MQ = 6; - pub const FILE = 7; -}; - -pub const PORT_ALERT = struct { - pub const SET = 0x01; - pub const UPDATE = 0x02; -}; - -/// User watchable file events. -pub const FILE_EVENT = struct { - pub const ACCESS = 0x00000001; - pub const MODIFIED = 0x00000002; - pub const ATTRIB = 0x00000004; - pub const DELETE = 0x00000010; - pub const RENAME_TO = 0x00000020; - pub const RENAME_FROM = 0x00000040; - pub const TRUNC = 0x00100000; - pub const NOFOLLOW = 0x10000000; - /// The filesystem holding the watched file was unmounted. - pub const UNMOUNTED = 0x20000000; - /// Some other file/filesystem got mounted over the watched file/directory. - pub const MOUNTEDOVER = 0x40000000; - - pub fn isException(event: u32) bool { - return event & (UNMOUNTED | DELETE | RENAME_TO | RENAME_FROM | MOUNTEDOVER) > 0; - } -}; - -pub const port_notify = extern struct { - /// Bind request(s) to port. - port: u32, - /// User defined variable. - user: ?*void, -}; - -pub const file_obj = extern struct { - /// Access time. - atim: timespec, - /// Modification time - mtim: timespec, - /// Change time - ctim: timespec, - __pad: [3]usize, - name: [*:0]u8, -}; - -// struct ifreq is marked obsolete, with struct lifreq preferred for interface requests. -// Here we alias lifreq to ifreq to avoid chainging existing code in os and x.os.IPv6. -pub const SIOCGLIFINDEX = IOWR('i', 133, lifreq); - -pub const lif_nd_req = extern struct { - addr: sockaddr.storage, - state_create: u8, - state_same_lla: u8, - state_diff_lla: u8, - hdw_len: i32, - flags: i32, - __pad: i32, - hdw_addr: [64]u8, -}; - -pub const lif_ifinfo_req = extern struct { - maxhops: u8, - reachtime: u32, - reachretrans: u32, - maxmtu: u32, -}; - -/// IP interface request. See if_tcp(7p) for more info. -pub const lifreq = extern struct { - // Not actually in a union, but the stdlib expects one for ifreq - ifrn: extern union { - /// Interface name, e.g. "lo0", "en0". - name: [IFNAMESIZE]u8, - }, - ru1: extern union { - /// For subnet/token etc. - addrlen: i32, - /// Driver's PPA (physical point of attachment). - ppa: u32, - }, - /// One of the IFT types, e.g. IFT_ETHER. - type: u32, - ifru: extern union { - /// Address. - addr: sockaddr.storage, - /// Other end of a peer-to-peer link. - dstaddr: sockaddr.storage, - /// Broadcast address. - broadaddr: sockaddr.storage, - /// Address token. - token: sockaddr.storage, - /// Subnet prefix. - subnet: sockaddr.storage, - /// Interface index. - ivalue: i32, - /// Flags for SIOC?LIFFLAGS. - flags: u64, - /// Hop count metric - metric: i32, - /// Maximum transmission unit - mtu: u32, - // Technically [2]i32 - muxid: packed struct { ip: i32, arp: i32 }, - /// Neighbor reachability determination entries - nd_req: lif_nd_req, - /// Link info - ifinfo_req: lif_ifinfo_req, - /// Name of the multipath interface group - groupname: [IFNAMESIZE]u8, - binding: [IFNAMESIZE]u8, - /// Zone id associated with this interface. - zoneid: zoneid_t, - /// Duplicate address detection state. Either in progress or completed. - dadstate: u32, - }, -}; - -const IoCtlCommand = enum(u32) { - none = 0x20000000, // no parameters - write = 0x40000000, // copy out parameters - read = 0x80000000, // copy in parameters - read_write = 0xc0000000, -}; - -fn ioImpl(cmd: IoCtlCommand, io_type: u8, nr: u8, comptime IOT: type) i32 { - const size = @as(u32, @intCast(@as(u8, @truncate(@sizeOf(IOT))))) << 16; - const t = @as(u32, @intCast(io_type)) << 8; - return @as(i32, @bitCast(@intFromEnum(cmd) | size | t | nr)); -} - -pub fn IO(io_type: u8, nr: u8) i32 { - return ioImpl(.none, io_type, nr, void); -} - -pub fn IOR(io_type: u8, nr: u8, comptime IOT: type) i32 { - return ioImpl(.write, io_type, nr, IOT); -} - -pub fn IOW(io_type: u8, nr: u8, comptime IOT: type) i32 { - return ioImpl(.read, io_type, nr, IOT); -} - -pub fn IOWR(io_type: u8, nr: u8, comptime IOT: type) i32 { - return ioImpl(.read_write, io_type, nr, IOT); -} - -// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1141 -// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those) -pub const IP = struct { - pub const OPTIONS = 1; - pub const HDRINCL = 2; - pub const TOS = 3; - pub const TTL = 4; - pub const RECVOPTS = 0x5; - pub const RECVRETOPTS = 0x6; - pub const RECVDSTADDR = 0x7; - pub const RETOPTS = 0x8; - pub const RECVIF = 0x9; - pub const RECVSLLA = 0xa; - pub const RECVTTL = 0xb; - pub const RECVTOS = 0xc; - pub const MULTICAST_IF = 0x10; - pub const MULTICAST_TTL = 0x11; - pub const MULTICAST_LOOP = 0x12; - pub const ADD_MEMBERSHIP = 0x13; - pub const DROP_MEMBERSHIP = 0x14; - pub const BLOCK_SOURCE = 0x15; - pub const UNBLOCK_SOURCE = 0x16; - pub const ADD_SOURCE_MEMBERSHIP = 0x17; - pub const DROP_SOURCE_MEMBERSHIP = 0x18; - pub const NEXTHOP = 0x19; - pub const PKTINFO = 0x1a; - pub const RECVPKTINFO = 0x1a; - pub const DONTFRAG = 0x1b; - pub const MINTTL = 0x1c; - pub const SEC_OPT = 0x22; - pub const BOUND_IF = 0x41; - pub const UNSPEC_SRC = 0x42; - pub const BROADCAST_TTL = 0x43; - pub const DHCPINIT_IF = 0x45; - pub const REUSEADDR = 0x104; - pub const DONTROUTE = 0x105; - pub const BROADCAST = 0x106; - // Same namespace, but these are arguments rather than option names - pub const DEFAULT_MULTICAST_TTL = 1; - pub const DEFAULT_MULTICAST_LOOP = 1; -}; - -// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1192 -// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those) -pub const IPV6 = struct { - pub const UNICAST_HOPS = 0x5; - pub const MULTICAST_IF = 0x6; - pub const MULTICAST_HOPS = 0x7; - pub const MULTICAST_LOOP = 0x8; - pub const JOIN_GROUP = 0x9; - pub const LEAVE_GROUP = 0xa; - pub const ADD_MEMBERSHIP = 0x9; - pub const DROP_MEMBERSHIP = 0xa; - pub const PKTINFO = 0xb; - pub const HOPLIMIT = 0xc; - pub const NEXTHOP = 0xd; - pub const HOPOPTS = 0xe; - pub const DSTOPTS = 0xf; - pub const RTHDR = 0x10; - pub const RTHDRDSTOPTS = 0x11; - pub const RECVPKTINFO = 0x12; - pub const RECVHOPLIMIT = 0x13; - pub const RECVHOPOPTS = 0x14; - pub const OLD_RECVDSTOPTS = 0x15; - pub const RECVRTHDR = 0x16; - pub const RECVRTHDRDSTOPTS = 0x17; - pub const CHECKSUM = 0x18; - pub const RECVTCLASS = 0x19; - pub const USE_MIN_MTU = 0x20; - pub const DONTFRAG = 0x21; - pub const SEC_OPT = 0x22; - pub const SRC_PREFERENCES = 0x23; - pub const RECVPATHMTU = 0x24; - pub const PATHMTU = 0x25; - pub const TCLASS = 0x26; - pub const V6ONLY = 0x27; - pub const RECVDSTOPTS = 0x28; - pub const MINHOPCOUNT = 0x2f; - pub const BOUND_IF = 0x41; - pub const UNSPEC_SRC = 0x42; - // Same namespace, but these are arguments rather than option names - pub const RTHDR_TYPE_0 = 0; - pub const PREFER_SRC_HOME = 0x01; - pub const PREFER_SRC_COA = 0x02; - pub const PREFER_SRC_PUBLIC = 0x04; - pub const PREFER_SRC_TMP = 0x08; - pub const PREFER_SRC_NONCGA = 0x10; - pub const PREFER_SRC_CGA = 0x20; - pub const PREFER_SRC_MIPMASK = PREFER_SRC_HOME | PREFER_SRC_COA; - pub const PREFER_SRC_MIPDEFAULT = PREFER_SRC_HOME; - pub const PREFER_SRC_TMPMASK = PREFER_SRC_PUBLIC | PREFER_SRC_TMP; - pub const PREFER_SRC_TMPDEFAULT = PREFER_SRC_PUBLIC; - pub const PREFER_SRC_CGAMASK = PREFER_SRC_NONCGA | PREFER_SRC_CGA; - pub const PREFER_SRC_CGADEFAULT = PREFER_SRC_NONCGA; - pub const PREFER_SRC_MASK = PREFER_SRC_MIPMASK | PREFER_SRC_TMPMASK | PREFER_SRC_CGAMASK; - pub const PREFER_SRC_DEFAULT = PREFER_SRC_MIPDEFAULT | PREFER_SRC_TMPDEFAULT | PREFER_SRC_CGADEFAULT; -}; - -// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/ip.h#L64 -pub const IPTOS = struct { - pub const LOWDELAY = 0x10; - pub const THROUGHPUT = 0x08; - pub const RELIABILITY = 0x04; - pub const ECT = 0x02; - pub const CE = 0x01; - pub const PREC_NETCONTROL = 0xe0; - pub const PREC_INTERNETCONTROL = 0xc0; - pub const PREC_CRITIC_ECP = 0xa0; - pub const PREC_FLASHOVERRIDE = 0x80; - pub const PREC_FLASH = 0x60; - pub const PREC_IMMEDIATE = 0x40; - pub const PREC_PRIORITY = 0x20; - pub const PREC_ROUTINE = 0x00; -}; diff --git a/lib/std/crypto/Certificate/Bundle.zig b/lib/std/crypto/Certificate/Bundle.zig index 437f7a224c3687e6ce76ad612820636301f39175..dd65b4cc4a6a871c22315ccc5f614836f830cadc 100644 --- a/lib/std/crypto/Certificate/Bundle.zig +++ b/lib/std/crypto/Certificate/Bundle.zig @@ -63,7 +63,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void { .freebsd, .openbsd => return rescanWithPath(cb, gpa, "/etc/ssl/cert.pem"), .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"), .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"), - .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"), + .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"), .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"), // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"), diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 57d6f45111ee653cd6414e51f1f23361fecbd4ab..f6287135e5085078631df3f16d4b8c182cfd6a97 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1368,7 +1368,6 @@ pub const have_segfault_handling_support = switch (native_os) { .watchos, .illumos, - .solaris, .windows, => true, @@ -1471,7 +1470,6 @@ fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopa .openbsd, => @intFromPtr(info.data.fault.addr), .illumos, - .solaris, => @intFromPtr(info.reason.fault.addr), else => comptime unreachable, }; diff --git a/lib/std/debug/SelfInfo/Elf.zig b/lib/std/debug/SelfInfo/Elf.zig index d9f48281dee935519e9aecbc549ece734286a88c..0f3c46e98095842831765fef44fbee9d1ce28fd2 100644 --- a/lib/std/debug/SelfInfo/Elf.zig +++ b/lib/std/debug/SelfInfo/Elf.zig @@ -160,9 +160,6 @@ pub const can_unwind: bool = s: { .x86, .x86_64, }, - .solaris => &.{ - .x86_64, - }, else => unreachable, }; diff --git a/lib/std/debug/cpu_context.zig b/lib/std/debug/cpu_context.zig index 03cf6e633df5d31d6735f46f8c053bda7522c727..9d460a1797f09e01b16e5810f55294c32d791493 100644 --- a/lib/std/debug/cpu_context.zig +++ b/lib/std/debug/cpu_context.zig @@ -961,7 +961,6 @@ const Powerpc = extern struct { // * System V Application Binary Interface - PowerPC Processor Supplement §3-46 // * Power Architecture 32-bit Application Binary Interface Supplement 1.0 - Linux & Embedded §3.4 // * 64-bit ELF V2 ABI Specification - Power Architecture Revision 1.5 §2.4 - // * ??? AIX? // // Are we having fun yet? @@ -1936,40 +1935,6 @@ const signal_ucontext_t = switch (native_os) { else => unreachable, }, }, - // This needs to be audited by someone with access to the Solaris headers. - .solaris => switch (native_arch) { - .sparc64 => @compileError("sparc64-solaris ucontext_t missing"), - .x86_64 => extern struct { - _flags: u64, - _link: ?*signal_ucontext_t, - _sigmask: std.c.sigset_t, - _stack: std.c.stack_t, - mcontext: extern struct { - r15: u64, - r14: u64, - r13: u64, - r12: u64, - r11: u64, - r10: u64, - r9: u64, - r8: u64, - rdi: u64, - rsi: u64, - rbp: u64, - rbx: u64, - rdx: u64, - rcx: u64, - rax: u64, - _trapno: i64, - _err: i64, - rip: u64, - _cs: i64, - _rflags: i64, - rsp: u64, - }, - }, - else => unreachable, - }, // https://github.com/illumos/illumos-gate/blob/d4ce137bba3bd16823db6374d9e9a643264ce245/usr/src/uts/intel/sys/ucontext.h .illumos => extern struct { _flags: usize, diff --git a/lib/std/dynamic_library.zig b/lib/std/dynamic_library.zig index 9504242cd578a9ff88d9bf193ff61dd25cf8ac18..92aea780bfbcff41d28b42085a27fb3823ba4b22 100644 --- a/lib/std/dynamic_library.zig +++ b/lib/std/dynamic_library.zig @@ -16,7 +16,7 @@ pub const DynLib = struct { else DlDynLib, .windows => WindowsDynLib, - .macos, .tvos, .watchos, .ios, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris, .illumos => DlDynLib, + .macos, .tvos, .watchos, .ios, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly, .illumos => DlDynLib, else => struct { const open = @compileError("unsupported platform"); const openZ = @compileError("unsupported platform"); @@ -672,7 +672,7 @@ pub const DlDynLib = struct { test "dynamic_library" { const libname = switch (native_os) { - .linux, .freebsd, .openbsd, .solaris, .illumos => "invalid_so.so", + .linux, .freebsd, .openbsd, .illumos => "invalid_so.so", .windows => "invalid_dll.dll", .macos, .tvos, .watchos, .ios, .visionos => "invalid_dylib.dylib", else => return error.SkipZigTest, diff --git a/lib/std/fs.zig b/lib/std/fs.zig index 6bfc41cd792bae2374345fa3de2a29af168fee7e..652480914f5d2035f427a9d317650c92f7cf0b8d 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -51,7 +51,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE /// * On other platforms, `[]u8` file paths are opaque sequences of bytes with /// no particular encoding. pub const max_path_bytes = switch (native_os) { - .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .solaris, .illumos, .plan9, .emscripten, .wasi, .serenity => posix.PATH_MAX, + .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .illumos, .plan9, .emscripten, .wasi, .serenity => posix.PATH_MAX, // Each WTF-16LE code unit may be expanded to 3 WTF-8 bytes. // If it would require 4 WTF-8 bytes, then there would be a surrogate // 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) { /// On WASI, file name components are encoded as valid UTF-8. /// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding. pub const max_name_bytes = switch (native_os) { - .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .solaris, .illumos, .serenity => posix.NAME_MAX, + .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .illumos, .serenity => posix.NAME_MAX, // Haiku's NAME_MAX includes the null terminator, so subtract one. .haiku => posix.NAME_MAX - 1, // Each WTF-16LE character may be expanded to 3 WTF-8 bytes. @@ -571,7 +571,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { error.NetworkNotFound => unreachable, // Windows-only else => |e| return e, }, - .solaris, .illumos => return posix.readlinkZ("/proc/self/path/a.out", out_buffer) catch |err| switch (err) { + .illumos => return posix.readlinkZ("/proc/self/path/a.out", out_buffer) catch |err| switch (err) { error.InvalidUtf8 => unreachable, // WASI-only error.InvalidWtf8 => unreachable, // Windows-only error.UnsupportedReparsePointType => unreachable, // Windows-only diff --git a/lib/std/fs/Dir.zig b/lib/std/fs/Dir.zig index 67f0c0d724b836d68223898524acf48252427c2c..14b26c89bd5a41765182b7c7ac9f3417b76a2e59 100644 --- a/lib/std/fs/Dir.zig +++ b/lib/std/fs/Dir.zig @@ -39,7 +39,7 @@ const IteratorError = error{ } || posix.UnexpectedError; pub const Iterator = switch (native_os) { - .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct { + .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos => struct { dir: Dir, seek: i64, buf: [1024]u8 align(@alignOf(posix.system.dirent)), @@ -57,7 +57,7 @@ pub const Iterator = switch (native_os) { switch (native_os) { .macos, .ios => return self.nextDarwin(), .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(), - .solaris, .illumos => return self.nextSolaris(), + .illumos => return self.nextIllumos(), else => @compileError("unimplemented"), } } @@ -116,7 +116,7 @@ pub const Iterator = switch (native_os) { } } - fn nextSolaris(self: *Self) !?Entry { + fn nextIllumos(self: *Self) !?Entry { start_over: while (true) { if (self.index >= self.end_index) { if (self.first_iter) { @@ -144,7 +144,7 @@ pub const Iterator = switch (native_os) { if (mem.eql(u8, name, ".") or mem.eql(u8, name, "..")) continue :start_over; - // Solaris dirent doesn't expose type, so we have to call stat to get it. + // illumos dirent doesn't expose type, so we have to call stat to get it. const stat_info = posix.fstatat( self.dir.fd, name, @@ -619,7 +619,6 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator { .netbsd, .dragonfly, .openbsd, - .solaris, .illumos, => return Iterator{ .dir = self, @@ -1770,7 +1769,7 @@ pub fn deleteFileZ(self: Dir, sub_path_c: [*:0]const u8) DeleteFileError!void { error.AccessDenied, error.PermissionDenied => |e| switch (native_os) { // non-Linux POSIX systems return permission errors when trying to delete a // directory, so we need to handle that case specifically and translate the error - .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => { + .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos => { // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them) const fstat = posix.fstatatZ(self.fd, sub_path_c, posix.AT.SYMLINK_NOFOLLOW) catch return e; const is_dir = fstat.mode & posix.S.IFMT == posix.S.IFDIR; diff --git a/lib/std/fs/File.zig b/lib/std/fs/File.zig index 169f3f5222bf2c4f5a310bbf74e6cd2076b888fb..ebc380987822d8eb6ed0e4b7e51b2b7b3ca52ce7 100644 --- a/lib/std/fs/File.zig +++ b/lib/std/fs/File.zig @@ -444,7 +444,7 @@ pub const Stat = struct { posix.S.IFSOCK => break :k .unix_domain_socket, else => {}, } - if (builtin.os.tag.isSolarish()) switch (m) { + if (builtin.os.tag == .illumos) switch (m) { posix.S.IFDOOR => break :k .door, posix.S.IFPORT => break :k .event_port, else => {}, diff --git a/lib/std/fs/get_app_data_dir.zig b/lib/std/fs/get_app_data_dir.zig index a256758a07e2c61d46f9c24c25b055b0449718ba..05b115956cee29fc1833ce1e8b4bfa7fe836ad42 100644 --- a/lib/std/fs/get_app_data_dir.zig +++ b/lib/std/fs/get_app_data_dir.zig @@ -30,7 +30,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi }; return fs.path.join(allocator, &[_][]const u8{ home_dir, "Library", "Application Support", appname }); }, - .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos, .serenity => { + .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos, .serenity => { if (posix.getenv("XDG_DATA_HOME")) |xdg| { if (xdg.len > 0) { return fs.path.join(allocator, &[_][]const u8{ xdg, appname }); diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 5f183133f34efbd6c1ecb1d2475eeda5401048ac..24d84c83c25835a8e6fe0f58d538efd1b97fc7b4 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -155,7 +155,7 @@ const CAllocator = struct { else {}; pub const supports_posix_memalign = switch (builtin.os.tag) { - .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => true, + .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => true, else => false, }; @@ -768,7 +768,7 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) { .sparc64 => 8 << 10, else => null, }, - .solaris, .illumos => switch (builtin.cpu.arch) { + .illumos => switch (builtin.cpu.arch) { // src/uts/*/sys/machparam.h .x86, .x86_64 => 4 << 10, .sparc, .sparc64 => 8 << 10, @@ -926,7 +926,7 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) { .sparc64 => 8 << 10, else => null, }, - .solaris, .illumos => switch (builtin.cpu.arch) { + .illumos => switch (builtin.cpu.arch) { // src/uts/*/sys/machparam.h .x86, .x86_64 => 4 << 10, .sparc, .sparc64 => 8 << 10, diff --git a/lib/std/os.zig b/lib/std/os.zig index f2519a62e90208447964f8bc5196da016e73be23..a3d659d4cad1510c35b52f430735eaeca6a9e993 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -80,7 +80,6 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool { .tvos, .visionos, .linux, - .solaris, .illumos, .freebsd, .serenity, @@ -147,7 +146,7 @@ pub fn getFdPath(fd: std.posix.fd_t, out_buffer: *[max_path_bytes]u8) std.posix. }; return target; }, - .solaris, .illumos => { + .illumos => { var procfs_buf: ["/proc/self/path/-2147483648\x00".len]u8 = undefined; const proc_path = std.fmt.bufPrintSentinel(procfs_buf[0..], "/proc/self/path/{d}", .{fd}, 0) catch unreachable; diff --git a/lib/std/posix.zig b/lib/std/posix.zig index dd38f8202d1b8b6a0a6eae0d761066f4d4c6b613..e602b47c7b0b7c36b13adc98678adbb0ea6bb46b 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -6035,7 +6035,7 @@ pub fn sigaction(sig: u8, noalias act: ?*const Sigaction, noalias oact: ?*Sigact switch (errno(system.sigaction(sig, act, oact))) { .SUCCESS => return, // EINVAL means the signal is either invalid or some signal that cannot have its action - // changed. For POSIX, this means SIGKILL/SIGSTOP. For e.g. Solaris, this also includes the + // changed. For POSIX, this means SIGKILL/SIGSTOP. For e.g. illumos, this also includes the // non-standard SIGWAITING, SIGCANCEL, and SIGLWP. Either way, programmer error. .INVAL => unreachable, else => unreachable, @@ -7414,7 +7414,6 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, data: usize) PtraceError!vo .wasi, .emscripten, .haiku, - .solaris, .illumos, .plan9, => @compileError("ptrace unsupported by target OS"), diff --git a/lib/std/posix/test.zig b/lib/std/posix/test.zig index ed329c911ee7e863a465b7388470c1922ae68175..50ffd7998fd253c8955b4134394fb4f84a60d808 100644 --- a/lib/std/posix/test.zig +++ b/lib/std/posix/test.zig @@ -186,7 +186,7 @@ test "linkat with different directories" { if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // `nstat.nlink` assertion is failing with LLVM 20+ for unclear reasons. switch (native_os) { - .wasi, .linux, .solaris, .illumos => {}, + .wasi, .linux, .illumos => {}, else => return error.SkipZigTest, } @@ -558,7 +558,7 @@ test "fcntl" { test "signalfd" { switch (native_os) { - .linux, .solaris, .illumos => {}, + .linux, .illumos => {}, else => return error.SkipZigTest, } _ = &posix.signalfd; @@ -577,7 +577,7 @@ test "sync" { test "fsync" { switch (native_os) { - .linux, .windows, .solaris, .illumos => {}, + .linux, .windows, .illumos => {}, else => return error.SkipZigTest, } @@ -708,7 +708,7 @@ test "sigset add/del" { test "dup & dup2" { switch (native_os) { - .linux, .solaris, .illumos => {}, + .linux, .illumos => {}, else => return error.SkipZigTest, } diff --git a/lib/std/process.zig b/lib/std/process.zig index 989e64085967c2408258b1bfa1b584ab93a9ed18..eb748e3b3ee497a9e3cf9ae6fc33d621d6a7e701 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1539,7 +1539,6 @@ pub fn getUserInfo(name: []const u8) !UserInfo { .netbsd, .openbsd, .haiku, - .solaris, .illumos, .serenity, => posixGetUserInfo(name), diff --git a/lib/std/start.zig b/lib/std/start.zig index 4cf2a0956b97fca90c406a41eb9968b6b1b6cd31..69207e690db30ee11e6556a5b8b66c5af975eed0 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -761,7 +761,7 @@ fn maybeIgnoreSigpipe() void { const have_sigpipe_support = switch (builtin.os.tag) { .linux, .plan9, - .solaris, + .illumos, .netbsd, .openbsd, .haiku, diff --git a/lib/std/zig/LibCInstallation.zig b/lib/std/zig/LibCInstallation.zig index 0414d32ee7d661c9202ad90a47c9adca637aa563..f6d381be8252f6f7428354dc10eb6b468421c010 100644 --- a/lib/std/zig/LibCInstallation.zig +++ b/lib/std/zig/LibCInstallation.zig @@ -198,7 +198,7 @@ pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation { try self.findNativeIncludeDirPosix(args); try self.findNativeGccDirHaiku(args); self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib"); - } else if (builtin.target.os.tag.isSolarish()) { + } else if (builtin.target.os.tag == .illumos) { // There is only one libc, and its headers/libraries are always in the same spot. self.include_dir = try args.allocator.dupeZ(u8, "/usr/include"); self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include"); @@ -935,7 +935,7 @@ pub const CrtBasenames = struct { .crtn = "crtn.o", }, }, - .solaris, .illumos => switch (mode) { + .illumos => switch (mode) { .dynamic_lib => .{ .crti = "crti.o", .crtn = "crtn.o", diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index f5fae5581a7084ff5687a2cd3a8fc72aac533904..0324e7670f16254155b26299f932909f62137452 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -228,7 +228,7 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target { error.InvalidVersion => {}, } }, - .solaris, .illumos => { + .illumos => { const uts = posix.uname(); const release = mem.sliceTo(&uts.release, 0); if (std.SemanticVersion.parse(release)) |ver| { @@ -1058,13 +1058,13 @@ fn detectAbiAndDynamicLinker( ) DetectError!Target { const native_target_has_ld = comptime Target.DynamicLinker.kind(builtin.os.tag) != .none; const is_linux = builtin.target.os.tag == .linux; - const is_solarish = builtin.target.os.tag.isSolarish(); + const is_illumos = builtin.target.os.tag == .illumos; const is_darwin = builtin.target.os.tag.isDarwin(); const have_all_info = query.dynamic_linker.get() != null and query.abi != null and (!is_linux or query.abi.?.isGnu()); const os_is_non_native = query.os_tag != null; - // The Solaris/illumos environment is always the same. - if (!native_target_has_ld or have_all_info or os_is_non_native or is_solarish or is_darwin) { + // The illumos environment is always the same. + if (!native_target_has_ld or have_all_info or os_is_non_native or is_illumos or is_darwin) { return defaultAbiAndDynamicLinker(cpu, os, query); } if (query.abi) |abi| { diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index 47af64bc964d826a719f89b2598974afd51c7d30..c459981dd6fe15fd83d553f528133ed629c6b9fc 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -99,7 +99,7 @@ pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths { return self; } - if (builtin.os.tag.isSolarish()) { + if (builtin.os.tag == .illumos) { try self.addLibDir("/usr/lib/64"); try self.addLibDir("/usr/local/lib/64"); try self.addLibDir("/lib/64"); diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index c94951dfa2a44f26d4e5aeb2fc6fa6ad2e3b98b2..42fa18da404c77dcc919492bc8dfde6f5a138037 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -211,7 +211,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8 .linux => "linux", .netbsd => "netbsd", .openbsd => "openbsd", - .solaris, .illumos => "solaris", + .illumos => "solaris", .windows, .uefi => "windows", .zos => "zos", .haiku => "haiku", diff --git a/src/link/Elf.zig b/src/link/Elf.zig index de506700fa04e24b92e86bc0e9b2185199aa6358..2537332c283249781bd74d3a7d379f7a63cf21f7 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1561,7 +1561,7 @@ pub fn writeElfHeader(self: *Elf) !void { else => switch (target.os.tag) { .freebsd, .ps4 => .FREEBSD, .hermit => .STANDALONE, - .illumos, .solaris => .SOLARIS, + .illumos => .SOLARIS, .openbsd => .OPENBSD, else => .NONE, }, diff --git a/src/link/Elf2.zig b/src/link/Elf2.zig index 9c8fc5fdc19ad27a2186a065efa50c1effb83a30..a050e361b55bd87d6df6b08a79be8c54e557df99 100644 --- a/src/link/Elf2.zig +++ b/src/link/Elf2.zig @@ -417,7 +417,7 @@ fn create( else => .NONE, .freestanding, .other => .STANDALONE, .netbsd => .NETBSD, - .solaris => .SOLARIS, + .illumos => .SOLARIS, .aix => .AIX, .freebsd => .FREEBSD, .cuda => .CUDA, diff --git a/src/target.zig b/src/target.zig index 79e647e641b46644f520aa33bb1d131d8afaedfb..858e6f7634ff7ca20992651a28276d2c2527cd6f 100644 --- a/src/target.zig +++ b/src/target.zig @@ -129,13 +129,13 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.builtin.Compil else => false, }, .x86 => switch (target.os.tag) { - .linux, .freebsd, .solaris, .illumos => true, + .linux, .freebsd, .illumos => true, .windows => !ofmt_c_msvc, else => false, }, .x86_64 => switch (target.os.tag) { .linux => target.abi != .gnux32 and target.abi != .muslx32, - .freebsd, .solaris, .illumos => true, + .freebsd, .illumos => true, .windows => !ofmt_c_msvc, else => false, }, @@ -257,7 +257,7 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool { if (target.cpu.arch.isSpirV()) return true; if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) { - if (target.os.tag.isSolarish()) { + if (target.os.tag == .illumos) { // https://github.com/ziglang/zig/issues/25699 return false; } @@ -428,8 +428,7 @@ pub fn libcFullLinkFlags(target: *const std.Target) []const []const u8 { // c compilers such as gcc or clang use. const result: []const []const u8 = switch (target.os.tag) { .dragonfly, .freebsd, .netbsd, .openbsd => &.{ "-lm", "-lpthread", "-lc", "-lutil" }, - // Solaris releases after 10 merged the threading libraries into libc. - .solaris, .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" }, + .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" }, .haiku => &.{ "-lm", "-lroot", "-lpthread", "-lc", "-lnetwork" }, .linux => switch (target.abi) { .android, .androideabi, .ohos, .ohoseabi => &.{ "-lm", "-lc", "-ldl" }, diff --git a/test/llvm_targets.zig b/test/llvm_targets.zig index f111b33f314d4c5f4d1bd61ecc755fd1ca0dcc2b..4fc41b532ff3c61061189913ef953f8997d777bd 100644 --- a/test/llvm_targets.zig +++ b/test/llvm_targets.zig @@ -254,7 +254,6 @@ const targets = [_]std.Target.Query{ .{ .cpu_arch = .sparc64, .os_tag = .netbsd, .abi = .none }, .{ .cpu_arch = .sparc64, .os_tag = .openbsd, .abi = .none }, .{ .cpu_arch = .sparc64, .os_tag = .rtems, .abi = .none }, - .{ .cpu_arch = .sparc64, .os_tag = .solaris, .abi = .none }, .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi }, .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf }, @@ -338,7 +337,6 @@ const targets = [_]std.Target.Query{ .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none }, .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none }, .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .solaris, .abi = .none }, .{ .cpu_arch = .x86_64, .os_tag = .tvos, .abi = .simulator }, .{ .cpu_arch = .x86_64, .os_tag = .uefi, .abi = .none }, .{ .cpu_arch = .x86_64, .os_tag = .visionos, .abi = .simulator }, diff --git a/test/src/ErrorTrace.zig b/test/src/ErrorTrace.zig index 3c781e3a3a8836e4d5ef88b75a4b8d6746ff5aac..bd3febef0e7a2047c4419df2bff0f375c27e0382 100644 --- a/test/src/ErrorTrace.zig +++ b/test/src/ErrorTrace.zig @@ -41,7 +41,7 @@ pub fn addCase(self: *ErrorTrace, case: Case) void { fn shouldTestNonLlvm(target: *const std.Target) bool { return switch (target.cpu.arch) { .x86_64 => switch (target.ofmt) { - .elf => !target.os.tag.isBSD() and !target.os.tag.isSolarish(), + .elf => !target.os.tag.isBSD() and target.os.tag != .illumos, else => false, }, else => false, diff --git a/test/src/StackTrace.zig b/test/src/StackTrace.zig index 721db139c2d4abb05010fbde242ead4e540692ff..8b2d514010fc98df8e128bc3af7981056255298a 100644 --- a/test/src/StackTrace.zig +++ b/test/src/StackTrace.zig @@ -46,7 +46,7 @@ fn addCaseTarget( ) void { const both_backends = switch (target.result.cpu.arch) { .x86_64 => switch (target.result.ofmt) { - .elf => !target.result.os.tag.isBSD() and !target.result.os.tag.isSolarish(), + .elf => !target.result.os.tag.isBSD() and target.result.os.tag != .illumos, else => false, }, else => false, diff --git a/test/standalone/posix/relpaths.zig b/test/standalone/posix/relpaths.zig index c6e0418ec653e723db9f121b802eb6b42d593c07..f7ced28cdbf1b654cd9921211393f112143c4bab 100644 --- a/test/standalone/posix/relpaths.zig +++ b/test/standalone/posix/relpaths.zig @@ -50,7 +50,7 @@ fn test_symlink(a: std.mem.Allocator, tmp: std.testing.TmpDir) !void { fn test_link(tmp: std.testing.TmpDir) !void { switch (builtin.target.os.tag) { - .linux, .solaris, .illumos => {}, + .linux, .illumos => {}, else => return, } diff --git a/test/tests.zig b/test/tests.zig index d83c95956a45570e4fced85351017588f4a9d8c4..a6931c408f4f2208e9f0819a07ac2149eec3db29 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt const cpu_arch = query.cpu_arch orelse builtin.cpu.arch; const os_tag = query.os_tag orelse builtin.os.tag; switch (cpu_arch) { - .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, + .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, .spirv32, .spirv64 => return false, else => return true, }