From abfa2158820c963cddc0c861168b16021d846825 Mon Sep 17 00:00:00 2001 From: Gregory Mullen <_@gr.ht> Date: Thu, 11 May 2023 13:10:20 -0700 Subject: [PATCH] add additional errno (INTR) to tcset,getpgrp calls Missed this originally because I was only able to trigger it when SA_RESTART was missing from the sigaction handlers. I'm unconvinced this is actually a sane way for stdlib to behave (see #15664). But this does duplicate the existing behavior throughout os.zig which IMO should be prioritized here. --- lib/std/os.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/os.zig b/lib/std/os.zig index 0b5a2f7e71..20f7e4ce22 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -6870,6 +6870,7 @@ pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t { .SUCCESS => return pgrp, .BADF => unreachable, .INVAL => unreachable, + .INTR => continue, .NOTTY => return error.NotATerminal, else => |err| return unexpectedErrno(err), } @@ -6888,6 +6889,7 @@ pub fn tcsetpgrp(handle: fd_t, pgrp: pid_t) TermioSetPgrpError!void { .SUCCESS => return, .BADF => unreachable, .INVAL => unreachable, + .INTR => continue, .NOTTY => return error.NotATerminal, .PERM => return TermioSetPgrpError.NotAPgrpMember, else => |err| return unexpectedErrno(err),