prepares a terminal for a new login session.
The file descriptor
must be opened for reading and writing on a terminal device.
It will be
made the controlling terminal for the calling process, after allocating
a new session with
This terminal device will also be made the standard input, standard output,
and standard error output of the calling process.
function returns -1 if it could not make the device referenced by
the controlling terminal of the calling process, and 0 otherwise.