1 LOGIN_TTY(3) Introduction to Library Functions LOGIN_TTY(3) 2 3 NAME 4 login_tty prepare a tty for a new login session 5 6 SYNOPSIS 7 #include <pty.h> 8 9 int 10 login_tty(int fd); 11 12 DESCRIPTION 13 The function login_tty() prepares a terminal for a new login session. 14 The file descriptor fd passed to login_tty() must be opened for reading 15 and writing on a terminal device. It will be made the controlling 16 terminal for the calling process, after allocating a new session with 17 setsid(2). This terminal device will also be made the standard input, 18 standard output, and standard error output of the calling process. 19 20 RETURN VALUES 21 The function returns -1 if setsid() fails or login_tty() could not make 22 the device referenced by fd the controlling terminal of the calling 23 process, and 0 otherwise. 24 25 INTERFACE STABILITY 26 Comitted 27 28 MT-LEVEL 29 Unsafe 30 31 SEE ALSO 32 dup2(3), ioctl(2), setsid(2), tty(1) 33 34 NexentaStor October 10, 2015 NexentaStor