authorgravatar for _@gr.htGregory Mullen <_@gr.ht> 2023-05-11 13:10:20-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-16 22:02:36-07:00
logabfa2158820c963cddc0c861168b16021d846825
tree421b9c0bc3509b7c1ddfb4aeefcaf2459efe9b2f
parent78c8cb4225c3c3d429764151ad703a4bfa67d75a

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.

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/os.zig+2
...@@ -6870,6 +6870,7 @@ pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t {...@@ -6870,6 +6870,7 @@ pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t {
6870 .SUCCESS => return pgrp,6870 .SUCCESS => return pgrp,
6871 .BADF => unreachable,6871 .BADF => unreachable,
6872 .INVAL => unreachable,6872 .INVAL => unreachable,
6873 .INTR => continue,
6873 .NOTTY => return error.NotATerminal,6874 .NOTTY => return error.NotATerminal,
6874 else => |err| return unexpectedErrno(err),6875 else => |err| return unexpectedErrno(err),
6875 }6876 }
...@@ -6888,6 +6889,7 @@ pub fn tcsetpgrp(handle: fd_t, pgrp: pid_t) TermioSetPgrpError!void {...@@ -6888,6 +6889,7 @@ pub fn tcsetpgrp(handle: fd_t, pgrp: pid_t) TermioSetPgrpError!void {
6888 .SUCCESS => return,6889 .SUCCESS => return,
6889 .BADF => unreachable,6890 .BADF => unreachable,
6890 .INVAL => unreachable,6891 .INVAL => unreachable,
6892 .INTR => continue,
6891 .NOTTY => return error.NotATerminal,6893 .NOTTY => return error.NotATerminal,
6892 .PERM => return TermioSetPgrpError.NotAPgrpMember,6894 .PERM => return TermioSetPgrpError.NotAPgrpMember,
6893 else => |err| return unexpectedErrno(err),6895 else => |err| return unexpectedErrno(err),