Returns the process group ID for the TTY associated with the given handle.
pub fn tcgetpgrp(handle: fd_t) TermioGetPgrpError!pid_t
pub 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),
}
}
}