login_tty() will fail if ioctl(2) fails to set fd to the controlling terminal of the calling process. ###>login_tty() will fail if ioctl(2) fails to set fd to the controlling terminal of the calling process.