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