Updated: April 19, 2023 |
Prepare for a login in a tty
#include <unix.h> int login_tty( int fd );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |