std.ps
tcgetpgrp(fd) -> pgid
fd
pgid
Get the foreground process group of a terminal
Returns the process group ID of the foreground process group of the terminal associated with the file descriptor fd.