pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t handle: fd_t1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t {
while (true) {
var pgrp: pid_t = undefined;
switch (errno(system.tcgetpgrp(handle, &pgrp))) {
.SUCCESS => return pgrp,
.BADF => unreachable,
.INVAL => unreachable,
.INTR => continue,
.NOTTY => return error.NotATerminal,
else => |err| return unexpectedErrno(err),
}
}
}
Returns the process group ID for the TTY associated with the given handle.