pub fn tcsetpgrp(handle: fd_t, pgrp: pid_t) TermioSetPgrpError!void 1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227pub fn tcsetpgrp(handle: fd_t, pgrp: pid_t) TermioSetPgrpError!void {
while (true) {
switch (errno(system.tcsetpgrp(handle, &pgrp))) {
.SUCCESS => return,
.BADF => unreachable,
.INVAL => unreachable,
.INTR => continue,
.NOTTY => return error.NotATerminal,
.PERM => return TermioSetPgrpError.NotAPgrpMember,
else => |err| return unexpectedErrno(err),
}
}
}
Sets the controlling process group ID for given TTY. handle must be valid fd_t to a TTY associated with calling process. pgrp must be a valid process group, and the calling process must be a member of that group.