The login_tty()
function
shall prepare the terminal device referenced by the file
descriptor fdr.
This function shall create a new session, make the terminal
the controlling terminal for the current process, and set the standard
input, output, and error streams of the current process to the terminal.
If fdr is not the standard input, output or error stream,
then login_tty()
shall close fdr.