authorgravatar for sayedmurtazamuttahary@gmail.commurtaza <sayedmurtazamuttahary@gmail.com> 2026-02-13 16:14:10+01:00
committergravatar for sayedmurtazamuttahary@gmail.commurtaza <sayedmurtazamuttahary@gmail.com> 2026-04-07 10:27:21+02:00
log4a1383d987130978bc66ba7cd7172c398684978d
tree3c0006c5d44bbe699fe33eb9756d0aadb9fb77ef
parent07b49c61ff8e84751d8a51e9b4d3bd2ffb7797de

process.Child: use std.posix.SIG instead of u32 for Child.Term stopped field


20 files changed, 44 insertions(+), 45 deletions(-)

lib/compiler/reduce.zig+1-1
......@@ -292,7 +292,7 @@ fn termToInteresting(term: std.process.Child.Term) Interestingness {
292292 return .boring;
293293 },
294294 .stopped => |sig| {
295 std.debug.print("interestingness check stopped with signal {d}\n", .{sig});
295 std.debug.print("interestingness check stopped with signal {t}\n", .{sig});
296296 return .boring;
297297 },
298298 .unknown => {
lib/compiler/std-docs.zig+1-1
......@@ -425,7 +425,7 @@ fn buildWasmBinary(
425425 },
426426 .stopped => |sig| {
427427 std.log.err(
428 "the following command stopped unexpectedly with signal {d}:\n{s}",
428 "the following command stopped unexpectedly with signal {t}:\n{s}",
429429 .{ sig, try std.Build.Step.allocPrintCmd(arena, .inherit, null, argv.items) },
430430 );
431431 return error.WasmCompilationFailed;
lib/std/Build.zig+2-2
......@@ -1899,11 +1899,11 @@ pub fn runAllowFail(
18991899 }
19001900 return stdout;
19011901 },
1902 .signal => |sig| {
1902 .signal, .stopped => |sig| {
19031903 out_code.* = @as(u8, @truncate(@intFromEnum(sig)));
19041904 return error.ProcessTerminated;
19051905 },
1906 .stopped, .unknown => |code| {
1906 .unknown => |code| {
19071907 out_code.* = @as(u8, @truncate(code));
19081908 return error.ProcessTerminated;
19091909 },
lib/std/Build/Step.zig+1-1
......@@ -728,7 +728,7 @@ pub fn handleChildProcessTerm(s: *Step, term: std.process.Child.Term) error{ Mak
728728 return switch (term) {
729729 .exited => |code| if (code != 0) s.fail("process exited with error code {d}", .{code}),
730730 .signal => |sig| s.fail("process terminated with signal {t}", .{sig}),
731 .stopped => |sig| s.fail("process stopped with signal {d}", .{sig}),
731 .stopped => |sig| s.fail("process stopped with signal {t}", .{sig}),
732732 .unknown => s.fail("process terminated unexpectedly", .{}),
733733 };
734734}
lib/std/Build/Step/Run.zig+3-3
......@@ -1173,7 +1173,7 @@ fn formatTerm(term: ?process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Error!
11731173 if (term) |t| switch (t) {
11741174 .exited => |code| try w.print("exited with code {d}", .{code}),
11751175 .signal => |sig| try w.print("terminated with signal {t}", .{sig}),
1176 .stopped => |sig| try w.print("stopped with signal {d}", .{sig}),
1176 .stopped => |sig| try w.print("stopped with signal {t}", .{sig}),
11771177 .unknown => |code| try w.print("terminated for unknown reason with code {d}", .{code}),
11781178 } else {
11791179 try w.writeAll("exited with any code");
......@@ -2804,8 +2804,8 @@ fn hashStdIo(hh: *std.Build.Cache.HashHelper, stdio: StdIo) void {
28042804 .expect_term => |term| {
28052805 hh.add(@as(std.meta.Tag(process.Child.Term), term));
28062806 switch (term) {
2807 inline .exited, .signal => |x| hh.add(x),
2808 .stopped, .unknown => |x| hh.add(x),
2807 inline .exited, .signal, .stopped => |x| hh.add(x),
2808 .unknown => |x| hh.add(x),
28092809 }
28102810 },
28112811 }
lib/std/Build/WebServer.zig+1-1
......@@ -683,7 +683,7 @@ fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optim
683683 },
684684 .stopped => |sig| {
685685 log.err(
686 "the following command stopped unexpectedly with signal {d}:\n{s}",
686 "the following command stopped unexpectedly with signal {t}:\n{s}",
687687 .{ sig, try Build.Step.allocPrintCmd(arena, .inherit, null, argv.items) },
688688 );
689689 return error.WasmCompilationFailed;
lib/std/Io/Threaded.zig+1-1
......@@ -15273,7 +15273,7 @@ fn childWaitPosix(child: *process.Child) process.Child.WaitError!process.Child.T
1527315273 return switch (code) {
1527415274 .EXITED => .{ .exited = @truncate(status) },
1527515275 .KILLED, .DUMPED => .{ .signal = @enumFromInt(status) },
15276 .TRAPPED, .STOPPED => .{ .stopped = status },
15276 .TRAPPED, .STOPPED => .{ .stopped = @enumFromInt(status) },
1527715277 _, .CONTINUED => .{ .unknown = status },
1527815278 };
1527915279 },
lib/std/Io/Uring.zig+1-1
......@@ -4729,7 +4729,7 @@ fn childWait(userdata: ?*anyopaque, child: *process.Child) process.Child.WaitErr
47294729 return switch (code) {
47304730 .EXITED => .{ .exited = @truncate(status) },
47314731 .KILLED, .DUMPED => .{ .signal = @enumFromInt(status) },
4732 .TRAPPED, .STOPPED => .{ .stopped = status },
4732 .TRAPPED, .STOPPED => .{ .stopped = @enumFromInt(status) },
47334733 _, .CONTINUED => .{ .unknown = status },
47344734 };
47354735 },
lib/std/c.zig+17-17
......@@ -3721,14 +3721,14 @@ pub const W = switch (native_os) {
37213721 pub fn TERMSIG(x: u32) SIG {
37223722 return @enumFromInt(status(x));
37233723 }
3724 pub fn STOPSIG(x: u32) u32 {
3725 return x >> 8;
3724 pub fn STOPSIG(x: u32) SIG {
3725 return @enumFromInt(x >> 8);
37263726 }
37273727 pub fn IFEXITED(x: u32) bool {
37283728 return status(x) == 0;
37293729 }
37303730 pub fn IFSTOPPED(x: u32) bool {
3731 return status(x) == stopped and STOPSIG(x) != 0x13;
3731 return status(x) == stopped and @as(u32, @intFromEnum(STOPSIG(x))) != 0x13;
37323732 }
37333733 pub fn IFSIGNALED(x: u32) bool {
37343734 return status(x) != stopped and status(x) != 0;
......@@ -3754,8 +3754,8 @@ pub const W = switch (native_os) {
37543754 pub fn TERMSIG(s: u32) SIG {
37553755 return @enumFromInt(s & 0x7f);
37563756 }
3757 pub fn STOPSIG(s: u32) u32 {
3758 return EXITSTATUS(s);
3757 pub fn STOPSIG(s: u32) SIG {
3758 return @enumFromInt(EXITSTATUS(s));
37593759 }
37603760 pub fn IFEXITED(s: u32) bool {
37613761 return (s & 0x7f) == 0;
......@@ -3782,8 +3782,8 @@ pub const W = switch (native_os) {
37823782 pub fn TERMSIG(s: u32) SIG {
37833783 return @enumFromInt(s & 0x7f);
37843784 }
3785 pub fn STOPSIG(s: u32) u32 {
3786 return EXITSTATUS(s);
3785 pub fn STOPSIG(s: u32) SIG {
3786 return @enumFromInt(EXITSTATUS(s));
37873787 }
37883788 pub fn IFEXITED(s: u32) bool {
37893789 return (s & 0x7f) == 0;
......@@ -3816,8 +3816,8 @@ pub const W = switch (native_os) {
38163816 pub fn TERMSIG(s: u32) SIG {
38173817 return @enumFromInt(s & 0x7f);
38183818 }
3819 pub fn STOPSIG(s: u32) u32 {
3820 return EXITSTATUS(s);
3819 pub fn STOPSIG(s: u32) SIG {
3820 return @enumFromInt(EXITSTATUS(s));
38213821 }
38223822 pub fn IFEXITED(s: u32) bool {
38233823 return (s & 0x7f) == 0;
......@@ -3850,8 +3850,8 @@ pub const W = switch (native_os) {
38503850 pub fn TERMSIG(s: u32) SIG {
38513851 return @enumFromInt(s & 0x7f);
38523852 }
3853 pub fn STOPSIG(s: u32) u32 {
3854 return EXITSTATUS(s);
3853 pub fn STOPSIG(s: u32) SIG {
3854 return @enumFromInt(EXITSTATUS(s));
38553855 }
38563856 pub fn IFEXITED(s: u32) bool {
38573857 return (s & 0x7f) == 0;
......@@ -3879,8 +3879,8 @@ pub const W = switch (native_os) {
38793879 return @enumFromInt((s >> 8) & 0xff);
38803880 }
38813881
3882 pub fn STOPSIG(s: u32) u32 {
3883 return (s >> 16) & 0xff;
3882 pub fn STOPSIG(s: u32) SIG {
3883 return @enumFromInt((s >> 16) & 0xff);
38843884 }
38853885
38863886 pub fn IFEXITED(s: u32) bool {
......@@ -3906,8 +3906,8 @@ pub const W = switch (native_os) {
39063906 pub fn TERMSIG(s: u32) SIG {
39073907 return @enumFromInt(s & 0x7f);
39083908 }
3909 pub fn STOPSIG(s: u32) u32 {
3910 return EXITSTATUS(s);
3909 pub fn STOPSIG(s: u32) SIG {
3910 return @enumFromInt(EXITSTATUS(s));
39113911 }
39123912 pub fn IFEXITED(s: u32) bool {
39133913 return (s & 0x7f) == 0;
......@@ -3938,8 +3938,8 @@ pub const W = switch (native_os) {
39383938 return @intCast((s & 0xff00) >> 8);
39393939 }
39403940
3941 pub fn STOPSIG(s: u32) u32 {
3942 return EXITSTATUS(s);
3941 pub fn STOPSIG(s: u32) SIG {
3942 return @enumFromInt(EXITSTATUS(s));
39433943 }
39443944
39453945 pub fn TERMSIG(s: u32) SIG {
lib/std/os/emscripten.zig+1-1
......@@ -228,7 +228,7 @@ pub const W = struct {
228228 return @enumFromInt(s & 0x7f);
229229 }
230230 pub fn STOPSIG(s: u32) u32 {
231 return EXITSTATUS(s);
231 return @enumFromInt(EXITSTATUS(s));
232232 }
233233 pub fn IFEXITED(s: u32) bool {
234234 return (s & 0x7f) == 0;
lib/std/os/linux.zig+2-2
......@@ -3883,8 +3883,8 @@ pub const W = struct {
38833883 pub fn TERMSIG(s: u32) SIG {
38843884 return @enumFromInt(s & 0x7f);
38853885 }
3886 pub fn STOPSIG(s: u32) u32 {
3887 return EXITSTATUS(s);
3886 pub fn STOPSIG(s: u32) SIG {
3887 return @enumFromInt(EXITSTATUS(s));
38883888 }
38893889 pub fn IFEXITED(s: u32) bool {
38903890 return (s & 0x7f) == 0;
lib/std/process/Child.zig+1-1
......@@ -94,7 +94,7 @@ pub const ResourceUsageStatistics = struct {
9494pub const Term = union(enum) {
9595 exited: u8,
9696 signal: std.posix.SIG,
97 stopped: u32,
97 stopped: std.posix.SIG,
9898 unknown: u32,
9999};
100100
lib/std/zig/system.zig+1-1
......@@ -1195,7 +1195,7 @@ fn detectAndroidApiLevel(io: Io) !u32 {
11951195 return error.ApiLevelQueryFailed;
11961196 },
11971197 .stopped => |sig| {
1198 std.log.err("getprop stopped abnormally with signal: {d}", .{sig});
1198 std.log.err("getprop stopped abnormally with signal: {t}", .{sig});
11991199 return error.ApiLevelQueryFailed;
12001200 },
12011201 .unknown => {
src/Compilation.zig+2-2
......@@ -5872,7 +5872,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
58725872 },
58735873 .stopped => |sig| {
58745874 log.err("clang failed with stderr: {s}", .{stderr});
5875 return comp.failCObj(c_object, "clang stopped with signal {d}", .{sig});
5875 return comp.failCObj(c_object, "clang stopped with signal {t}", .{sig});
58765876 },
58775877 .unknown => {
58785878 log.err("clang terminated with stderr: {s}", .{stderr});
......@@ -6302,7 +6302,7 @@ fn spawnZigRc(
63026302 return comp.failWin32Resource(win32_resource, "zig rc terminated unexpectedly", .{});
63036303 },
63046304 .stopped => |sig| {
6305 log.err("zig rc stopped {d} with stderr:\n{s}", .{ sig, stderr });
6305 log.err("zig rc stopped {t} with stderr:\n{s}", .{ sig, stderr });
63066306 return comp.failWin32Resource(win32_resource, "zig rc terminated unexpectedly", .{});
63076307 },
63086308 .unknown => {
src/link/Lld.zig+1-1
......@@ -1733,7 +1733,7 @@ fn spawnLld(comp: *Compilation, arena: Allocator, argv: []const []const u8) !voi
17331733 },
17341734 .stopped => |sig| {
17351735 if (comp.clang_passthrough_mode) std.process.abort();
1736 return diags.fail("{s} stopped with signal {d} and stderr:\n{s}", .{ argv[0], sig, stderr });
1736 return diags.fail("{s} stopped with signal {t} and stderr:\n{s}", .{ argv[0], sig, stderr });
17371737 },
17381738 .unknown => |code| {
17391739 if (comp.clang_passthrough_mode) std.process.abort();
src/main.zig+3-3
......@@ -4582,7 +4582,7 @@ fn runOrTest(
45824582 },
45834583 .stopped => |sig| {
45844584 const cmd = try std.mem.join(arena, " ", argv.items);
4585 fatal("the following command stopped with signal {d}:\n{s}", .{ sig, cmd });
4585 fatal("the following command stopped with signal {t}:\n{s}", .{ sig, cmd });
45864586 },
45874587 .unknown => {
45884588 process.exit(1);
......@@ -5637,7 +5637,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
56375637 },
56385638 .stopped => |sig| {
56395639 const cmd = try std.mem.join(arena, " ", child_argv.items);
5640 fatal("the following build command stopped with signal {d}:\n{s}", .{ sig, cmd });
5640 fatal("the following build command stopped with signal {t}:\n{s}", .{ sig, cmd });
56415641 },
56425642 .unknown => {
56435643 const cmd = try std.mem.join(arena, " ", child_argv.items);
......@@ -5943,7 +5943,7 @@ fn jitCmdInner(
59435943 },
59445944 .stopped => |sig| {
59455945 const cmd = try std.mem.join(arena, " ", child_argv.items);
5946 fatal("the following build command stopped with signal {d}:\n{s}", .{ sig, cmd });
5946 fatal("the following build command stopped with signal {t}:\n{s}", .{ sig, cmd });
59475947 },
59485948 .unknown => {
59495949 const cmd = try std.mem.join(arena, " ", child_argv.items);
tools/doctest.zig+1-1
......@@ -1142,7 +1142,7 @@ fn run(
11421142 return error.ChildCrashed;
11431143 },
11441144 .stopped => |sig| {
1145 std.debug.print("{s}\nThe following command stopped with signal {d}:\n", .{ result.stderr, sig });
1145 std.debug.print("{s}\nThe following command stopped with signal {t}:\n", .{ result.stderr, sig });
11461146 dumpArgs(args);
11471147 return error.ChildCrashed;
11481148 },
tools/incr-check.zig+3-3
......@@ -569,7 +569,7 @@ const Eval = struct {
569569 eval.fatal("generated executable '{s}' terminated with signal {t}", .{ binary_path, sig });
570570 },
571571 .stopped => |sig| {
572 eval.fatal("generated executable '{s}' stopped with signal {d}", .{ binary_path, sig });
572 eval.fatal("generated executable '{s}' stopped with signal {t}", .{ binary_path, sig });
573573 },
574574 .unknown => {
575575 eval.fatal("generated executable '{s}' terminated unexpectedly", .{binary_path});
......@@ -639,7 +639,7 @@ const Eval = struct {
639639 switch (result.term) {
640640 .exited => |code| eval.fatal("zig cc for '{s}' failed with code {d}", .{ c_path, code }),
641641 .signal => |sig| eval.fatal("zig cc for '{s}' terminated unexpectedly with signal {t}", .{ c_path, sig }),
642 .stopped => |sig| eval.fatal("zig cc for '{s}' stopped unexpectedly with signal {d}", .{ c_path, sig }),
642 .stopped => |sig| eval.fatal("zig cc for '{s}' stopped unexpectedly with signal {t}", .{ c_path, sig }),
643643 .unknown => eval.fatal("zig cc for '{s}' terminated unexpectedly", .{c_path}),
644644 }
645645 }
......@@ -919,7 +919,7 @@ fn waitChild(child: *std.process.Child, eval: *Eval) void {
919919 switch (term) {
920920 .exited => |code| if (code != 0) eval.fatal("compiler failed with code {d}", .{code}),
921921 .signal => |sig| eval.fatal("compiler terminated with signal {t}", .{sig}),
922 .stopped => |sig| eval.fatal("compiler stopped unexpectedly with signal {d}", .{sig}),
922 .stopped => |sig| eval.fatal("compiler stopped unexpectedly with signal {t}", .{sig}),
923923 .unknown => eval.fatal("compiler terminated unexpectedly", .{}),
924924 }
925925}
tools/update_clang_options.zig-1
......@@ -699,7 +699,6 @@ pub fn main(init: std.process.Init) !void {
699699 .unknown => {
700700 fatal("llvm-tblgen crashed\n", .{});
701701 },
702 else => fatal("llvm-tblgen crashed", .{}),
703702 };
704703
705704 const parsed = try json.parseFromSlice(json.Value, arena, json_text, .{});
tools/update_cpu_features.zig+1-1
......@@ -2017,7 +2017,7 @@ fn processOneTarget(io: Io, job: Job) void {
20172017 std.process.exit(1);
20182018 },
20192019 .stopped => |sig| {
2020 std.debug.print("llvm-tblgen stopped with signal {d}\n", .{sig});
2020 std.debug.print("llvm-tblgen stopped with signal {t}\n", .{sig});
20212021 std.process.exit(1);
20222022 },
20232023 .unknown => {