Prepare for a login in a tty
#include <unix.h> int login_tty( int fd );
- A file descriptor that you want to use as the controlling terminal for the current process.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
This function is in libc.a, but not in libc.so (in order to save space).
The login_tty() function prepares for a login on the tty fd (which may be a real tty device, or the slave of a pseudo-tty as returned by openpty() ) by creating a new session, making fd the controlling terminal for the current process, setting fd to be the standard input, output, and error streams of the current process, and closing fd.
This function fails if ioctl() fails to set fd to the controlling terminal of the current process.
- An error occurred; errno is set.
Last modified: 2013-12-23