login_tty()
QNX SDP8.0C Library ReferenceAPIDeveloper
Prepare for a login in a tty
Synopsis:
#include <unix.h>
int login_tty( int fd );
Arguments:
- fd
- A file descriptor that you want to use as the controlling terminal for the current process.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
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.
Returns:
- 0
- Success.
- -1
- An error occurred; errno is set.
Errors:
- EBADF
- The fd argument isn't a valid file descriptor.
- ENOSYS
- The argument fd isn't associated with a terminal device.
Classification:
Safety: | |
---|---|
Cancellation point | Yes |
Signal handler | Yes |
Thread | Yes |
Page updated: