Name
login_tty -- find and open an available pseudo-tty
Description
The login_tty() function sets up for a login on the tty referenced by the file descriptor fd: create a new session, make the tty for the current process the controlling terminal, set the standard input, output, and error streams of the current process, and closing fd.
Return Value
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.