std.ps
tiocstty(fd)
fd
Set the controlling terminal for the current process
Sets the controlling terminal for the current process to the terminal associated with the file descriptor fd. This is typically used in process managers and shells.